That sounds a lot like the dependencies aren't quite correct. We've actually
just started talking about this on the dev list to come up with a way to
make this much easier for app developers. Anyway, if you take a look at the
helloworld sample i just committed [1] that shows about the simplest i could
come up with that shows how to do what you want. You can call that webapp
service by using the tuscany helloworld-ws-reference sample by changing the
wsdl port location to be:
http://localhost:8080/sample-helloworld-ws-service-webapp/SCA/HelloWorldComponent/HelloWorldService

I'll go try to get the calculator-webapp-ws sample working as well so
there's two examples.

  ...ant

[1]
https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-ws-service-webapp


On 7/26/07, Radim Kolarik <[EMAIL PROTECTED]> wrote:

Hi,

I made some progress with this, but it doesn't do exactly what I need it
to do.

In my META-INF folder, I have sca-contribution.xml file, which looks like
this:
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";
              targetNamespace="http://helloworld";
              xmlns:sample="http://helloworld";>
   <deployable composite="sample:helloworldws"/>
</contribution>

This is my .composite file:
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
        targetNamespace="http://helloworld";
        xmlns:hw="http://helloworld";
    name="helloworldws">

    <component name="HelloWorldServiceComponent">
            <service name="HelloWorldService">
                <interface.java interface="helloworld.HelloWorldService"/>
          <binding.ws
wsdlElement="
http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
            </service>
      <implementation.java class="helloworld.HelloWorldImpl" />
    </component>

</composite>

The important section in the WSDL file is:
    <wsdl:service name="HelloWorldService">
        <wsdl:port binding="tns:HelloWorldSoapBinding"
name="HelloWorldSoapPort">
            <wsdlsoap:address
location="
http://localhost:8090/helloworldServiceWAR/HelloWorldServiceComponent/HelloWorldService
"/>
        </wsdl:port>
    </wsdl:service>

Now my Tomcat is running on port 8080. As you can see, I had to
specify port 8090 in WSDL, which made my service WSDL accessible via:

http://localhost:8090/helloworldServiceWAR/HelloWorldServiceComponent/HelloWorldService?wsdl

When I had the port in WSDL file set to 8080, I got an exception:
java.net.BindException: Address already in use: bind

That would suggest that some "standalone" engine is being inicialized
which binds the service to port specified in WSDL. But what if I
wanted the service to be handled directly by Tomcat? Would it be
possible?

By the way, my webapp uses the same JAR files in its WEB-INF/lib
directory as were created using maven build of calculator-webapp-ws
sample (I understand that I shouldn't have
tuscany-sca-all-0.90-incubating.jar in web application class path).

Thanks,
Radim

On 7/26/07, Simon Laws <[EMAIL PROTECTED]> wrote:
> On 7/26/07, ant elder <[EMAIL PROTECTED]> wrote:
> >
> > That composite you have unfortunately wont work with Tuscany as we
don't
> > yet
> > support web services without pre-existing wsdl. So you need to change
> > either
> > the <binding.ws> to reference a wsdl or change the <service> to use <
> > interface.wsdl>. Thats on the current plan to fix in the next release
> > which
> > is targeted for August. This has come up a few times recently so i'll
go
> > start work on that now.
> >
> > I have a helloworld-ws-service webapp sample that I've just noticed
I've
> > never committed, i'll commit that now so there's at least something
that
> > can
> > be used as a base to start from.
> >
> > Additionally on the url below, it shouldn't have a slash before ?wsdl
so
> > should be:
> >
> >
http://localhost:8080/helloworldServiceWAR/HelloWorldServiceComponent/HelloWorldService?wsdl
> >
> >    ...ant
> >
> > On 7/26/07, Radim Kolarik <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi Ant,
> > >
> > > I tried it as you suggested, so I deployed the service with
> > > <binding.ws/> only, and tried to access the application using the :
> > >
> > > [webappSerletUrl]/componentName/serviceName
> > >
> > > but without success. I am still getting the
> > > No servlet registered for path:
> > > /HelloWorldServiceComponent/HelloWorldService/ exception.
> > >
> > > Here is the helloworldws.composite file that I use:
> > >
> > > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
> > >         targetNamespace="http://helloworld";
> > >         xmlns:hw="http://helloworld";
> > >     name="helloworldws">
> > >
> > >     <component name="HelloWorldServiceComponent">
> > >             <service name="HelloWorldService">
> > >                 <interface.java interface="
helloworld.HelloWorldService"
> > > />
> > >                 <binding.ws/>
> > >             </service>
> > >         <implementation.java class="helloworld.HelloWorldImpl" />
> > >     </component>
> > >
> > > </composite>
> > >
> > > and the URL that doesn't work is
> > >
> > >
> >
http://localhost:8080/helloworldServiceWAR/HelloWorldServiceComponent/HelloWorldService/?wsdl
> > >
> > > Thanks,
> > > Radim
> > >
> > > On 7/26/07, ant elder <[EMAIL PROTECTED]> wrote:
> > > > On 7/26/07, Simon Laws <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > On 7/26/07, Radim Kolarik <[EMAIL PROTECTED] > wrote:
> > > > > >
> > > > > > Hi Reymond,
> > > > > >
> > > > > > Thank you for your reply.
> > > > > >
> > > > > > How do I run the example if it is deployed to a web server,
such
> > as
> > > > > > Tomcat? I found an information about TuscanyServlet, which
needs
> > to
> > > be
> > > > > > in web.xml file, which I have now.
> > > > > >
> > > > > > Let's say that my server's root context and web app context
URL is
> > > > > > http://localhost:8080/myWebApp . What do I have to add after
this
> > > URL
> > > > > > to be able to access the application? According to SCA spec,
the
> > web
> > > > > > service WSDL should be available if the URL ends with ?wsdl.
But
> > if
> > > I
> > > > > > type http://localhost:8080/myWebApp/?wsdl in the browser, I
get an
> > > > > > exception:
> > > > > >
> > > > > > SEVERE: Servlet.service() for servlet TuscanyServlet threw
> > exception
> > > > > > java.lang.IllegalStateException: No servlet registered for
path: /
> > > > > >         at
org.apache.tuscany.sca.webapp.TuscanyServlet.service(
> > > > > > TuscanyServlet.java:57)
> > > > > >         at
> > > > > >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > > > > > ApplicationFilterChain.java:290)
> > > > > >         at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > > > > > ApplicationFilterChain.java:206)
> > > > > >         at
org.apache.catalina.core.StandardWrapperValve.invoke(
> > > > > > StandardWrapperValve.java:230)
> > > > > >         at
org.apache.catalina.core.StandardContextValve.invoke(
> > > > > > StandardContextValve.java:175)
> > > > > >         at org.apache.catalina.core.StandardHostValve.invoke (
> > > > > > StandardHostValve.java:128)
> > > > > >         at org.apache.catalina.valves.ErrorReportValve.invoke(
> > > > > > ErrorReportValve.java:104)
> > > > > >         at org.apache.catalina.core.StandardEngineValve.invoke
(
> > > > > > StandardEngineValve.java:109)
> > > > > >         at org.apache.catalina.connector.CoyoteAdapter.service
(
> > > > > > CoyoteAdapter.java:261)
> > > > > >         at org.apache.coyote.http11.Http11Processor.process(
> > > > > > Http11Processor.java:844)
> > > > > >         at
> > > > > >
> > >
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
> > > > > > Http11Protocol.java:581)
> > > > > >         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
> > > > > > JIoEndpoint.java:447)
> > > > > >         at java.lang.Thread.run(Thread.java:595)
> > > > > >
> > > > > > I did some debugging on this and it seems that the servlet
tries
> > to
> > > > > > obtain a mapping from a Map, which is empty. Is this a bug or
am I
> > > > > > just missing something in my .composite file or WSDL?
> > > > > >
> > > > > > Also, did you create the WSDL file manually or did you use any
> > > > > > generation tool provided by Tuscany?
> > > > > >
> > > > > > Thanks,
> > > > > > Radim
> > > > > >
> > > > > > On 7/25/07, Raymond Feng <[EMAIL PROTECTED]> wrote:
> > > > > > > Hi, Radim.
> > > > > > >
> > > > > > > I'm not very sure if we already have the support to deploy
an
> > SCA
> > > > > > service as
> > > > > > > a web service without WSDL. If not, that's something we want
to
> > > > > support
> > > > > > for
> > > > > > > sure.
> > > > > > >
> > > > > > > We have a sample to demonstrate the usage of SCA, web
service
> > and
> > > SDO.
> > > > > > It
> > > > > > > seems to be what you are looking for. You can see the sample
> > code
> > > at:
> > > > > > >
> > > > > > >
> > > > >
> > >
> >
https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-ws-sdo
> > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Raymond
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Radim Kolarik" < [EMAIL PROTECTED]>
> > > > > > > To: < [email protected]>
> > > > > > > Sent: Wednesday, July 25, 2007 7:38 AM
> > > > > > > Subject: Services and WSDL files
> > > > > > >
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Is it necessary to supply wsdl file if I want to deploy an
SCA
> > > > > service
> > > > > > as
> > > > > > > > a
> > > > > > > > web service? Or can Tuscany generate the file "on the
fly"?
> > > > > > > >
> > > > > > > > If I need to supply the file myself, what would be the
best
> > way
> > > to
> > > > > > > > generate
> > > > > > > > the file? Is it possible to generate the file for SDOs, if
> > they
> > > are
> > > > > > > > service
> > > > > > > > parameters or if a service returns an SDO object as its
> > result?
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Radim
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > >
---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
[EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail:
[EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > >
---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail:
[EMAIL PROTECTED]
> > > > > >
> > > > > > Hi Radim
> > > > >
> > > > > Someone else is asking a similar question [1]. As part of this I
> > made
> > > a
> > > > > sample [2] to experiment with exposing web services through the
web
> > > app
> > > > > container. There are a few wrinkles in getting this to work. To
make
> > > it
> > > > > work
> > > > > I hand created WSDL conatining a service URL that matched where
I
> > knew
> > > the
> > > > > service was going to be deployed. For example.
> > > > >
> > > > > In the sample [2] the URL that is registered with the web app
> > relates
> > > to
> > > > > the
> > > > > single service that is described in the  .composite file [3]
> > > > >
> > > > >     <component name="AddServiceComponent">
> > > > >         <implementation.java class="calculator.AddServiceImpl"/>
> > > > >         <service name="AddService">
> > > > >             <interface.java interface="calculator.AddService" />
> > > > >             <binding.ws
> > > > > wsdlElement="http://calculator#wsdl.port(AddService/AddSoapPort)
> > > > > <http://calculator/#wsdl.port%28AddService/AddSoapPort%29>"/>
> > > > >         </service>
> > > > >     </component>
> > > > >
> > > > > And, in this case, takes its value from the WSDL service
description
> > > [3]
> > > > >
> > > > >     <wsdl:service name="AddService">
> > > > >
> > > > >         <wsdl:port binding="tns:AddSoapBinding"
name="AddSoapPort">
> > > > >
> > > > >             <wsdlsoap:address
> > > > > location="
> > > > >
> > http://localhost:8080/sample-calculator-webapp-ws/services/AddService
> > > "/>
> > > > >         </wsdl:port>
> > > > >     </wsdl:service>
> > > > >
> > > > > I.e, I see the value.
> > > > >
> > > > >
> > >
> >
http://localhost:8080/sample-calculator-webapp-ws/services/AddServiceregistered
> > > > > in the WebAppServletHost
> > > > >
> > > > > The important thing here is that the URL I hand edited into the
WSDL
> > > file
> > > > > matches the URL that the web app is deployed at. In my case I'm
> > > deploying
> > > > > the WAR to tomcat and it ends up at
> > > > > http://localhost:8080/sample-calculator-webapp-ws
> > > > > . The web.xml file maps "/services" to the TuscanyServlet so
that
> > > appears
> > > > > too and finally the name of the service.
> > > > >
> > > > > Now this all feels a little complicated to me, I.e Reading the
spec
> > I
> > > > > would
> > > > > expect just to be able to specify a service name and have the
> > runtime
> > > > > construct the URL automatically for me. In fact this is how I
think
> > > the
> > > > > TuscanyServlet is coded, in that it only looks for registered
> > servlets
> > > > > based
> > > > > on path info, and what I think the assembly spec says.  The
problem
> > is
> > > it
> > > > > doesn't appear to be easy to configure the .composite file with
just
> > > path
> > > > > info and also keep axis happy.  I've tried a few things, e.g.
> > > > >
> > > > > <binding.ws>
> > > > > < binding.ws uri="...">
> > > > >
> > > > > But Axis complains. So maybe someone (Raymond?) can tell us what
the
> > > magic
> > > > > rune is to make this work but for the time being the code in
trunk
> > > works
> > > > > for
> > > > > the sample.  I have opened JIRA TUSCANY-1481 on this so we have
a
> > > marker
> > > > > but
> > > > > it sounds like you are making some progress debugging
so  feel  free
> > > to
> > > > > attach notes if you feel it's appropriate.
> > > > >
> > > > > Regards
> > > > >
> > > > > Simon
> > > > >
> > > > >
> > > > > [1]
> > >
http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg01434.html
> > > > >   Note. There are a couple of mails missing off this thread that
I
> > > didn't
> > > > > send to the user list by accident. Just forwarded them now so
> > > hopefully
> > > > > the
> > > > > archive will catch up sortly
> > > > >
> > > > >
> > >
> >
[2]http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-webapp-ws/
> > > > >
> > > > >
> > >
> >
[3]http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-webapp-ws/src/main/resources/Calculator.composite
> > > > >
> > > > >
> > >
> >
[4]http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-webapp-ws/src/main/resources/wsdl/add.wsdl
> > > > >
> > > >
> > > > See:
> > > >
> > >
> >
http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200707.mbox/browser
> > > > and: http://incubator.apache.org/tuscany/sca-java-bindingws.html
> > > >
> > > > Basically, if you reference the WSDL port it will use that,
otherwise
> > > the
> > > > url is constructed from the component name, service name and
binding
> > > URI. I
> > > > find for services its easiest to just leave it all out eg ,<
> > binding.ws/>,
> > > in
> > > > which case the uri will be the
> > > [webappSerletUrl]/componentName/serviceName,
> > > > and for references to explicitly use the uri attribute, eg <
> > binding.wsuri="
> > > > http://somehost/someService"; />
> > > >
> > > >   ...ant
> > > >
> > >
> >
> There is a calculator-webapp-ws sample also
>
> Simon
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to