Thanks Simon, I will try this out.

-----Original Message-----
From: Simon Laws [mailto:[email protected]] 
Sent: Friday, May 29, 2009 08:07
To: [email protected]
Subject: Re: Creating a virtual service using SCA

On Thu, May 28, 2009 at 10:31 PM, Phillips, Chad <[email protected]> wrote:
> Hi,
>
> I'm in the processes of creating a virtual service using Tuscany SCA
> Java 1.5 (snapshot from the 1.x branch) but I'm running into some issues
> w/ setting everything up.  The basic scenario goes like this:
>
> 1.) Take an existing WSDL, generate skeletons/DOs from the WSDL that
> will be used for my SCA service interface
> 2.) Create the component implementation that implements the service
> interface from step 1 and setup the composite file so that the existing
> WSDL is used instead of a new WSDL being auto-generated
> 3.) Create a reference using the interface in 1. that will be resolved
> by an endpoint on a different server (service conforms to the same
> service); this will be used by the component created in step 2 to
> fulfill the end users request
>
> I'm current stuck at steps 1 and 2.  I've generated some skeletons as
> well as a component/composite but I'm not sure how the wsdlElement
> attribute of the binding.ws should be setup so that the existing WSDL is
> used.  I've been looking through the sample applications as well as the
> documentation at [1] but I'm still unclear as to what I need to do.
> I've tried a couple of different combinations but I'm getting errors
> like: "org.osoa.sca.ServiceRuntimeException: PortType
> {http://foo/}BarService in BarComponent/BarService was not found."  Can
> anyone provide me w/ some direction as to how the wsdlElement attribute
> should be used for what I'm trying to accomplish?  I can create an
> example app if that would make things clearer.
>
> [1] http://tuscany.apache.org/sca-java-bindingws.html
>
> - Chad Phillips
>

Hi Chad

I was looking at some different combinations for someone else the
other day so those tests may help you out. I documented what I was
doing here (http://issues.apache.org/jira/browse/TUSCANY-2900). And
you can find the actual composite here
(http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/wsdlgen/src/main/resources/helloworld.composite)
inside the wsdlgen test.

Note. I was setting up this test to look at SOAP/JMS WSDL bindings
initially but the same patterns hold true for SOAP/HTTP WSDL bindings.

If you want to use the existing WSDL in your service interface then
you need to point to the port type of the WSDL you've provided, e.g.

<service name="HelloWorldService">
  <interface.wsdl
interface="http://helloworld/#wsdl.interface(HelloWorldService)"/>
  <binding.ws uri="..."/>
</service>

If you want to go further and configure the web service binding from
the binding info then refer to the service or the port from the
binding itself

<service name="HelloWorldService">
  <binding.ws 
wsdlElement="http://helloworld/#wsdl.port(HelloWorldService/HelloWorldJmsPort)"/>
</service>

or

<service name="HelloWorldService">
<binding.ws wsdlElement="http://helloworld/#wsdl.service(HelloWorldService)"/>
</service>

If you then do ?wsdl on the resulting service URI you will see the
slightly surprising effect of having a generated WSDL that includes
the existing WSDL. But it should be representative of what you have
specified. See my notes on TUSCANY-2900 for examples of what the
results look like.

Simon

Reply via email to