Ok i try as you described but i get the following error whrn tuscany try to
examine the implementation tag:
GRAVE: Contribution Resolve Exception occured due to:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tuscany.sca.launcher.LauncherMain.invokeMainMethod(LauncherMain.java:114)
at
org.apache.tuscany.sca.launcher.LauncherMain.main(LauncherMain.java:55)
Caused by: java.lang.IllegalStateException:
org.apache.tuscany.sca.contribution.processor.ContributionResolveException:
org.apache.tuscany.sca.contribution.processor.ContributionResolveException:
Processing composite {http://sample}Calculator: Resolving Java implementation:
it.netbureau.prova.ProvaWS
at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:94)
at sample.SampleClientImpl.main(SampleClientImpl.java:37)
... 6 more
The sample client is like the java code written for CalculatorBinding example.
this is the composite declaration:
<component name="ProvaWSService">
<implementation.java class="it.netbureau.prova.ProvaWS"/>
<reference name="externalWSProvaWS">
<binding.ws
wsdlElement="http://prova.netbureau.it/#wsdl.port(provaWSService/provaWSPort)"
uri="http://localhost:8080/ProvaWS/provaWS"/>
</reference>
</component>
<component name="SampleClient">
<implementation.java class="calculator.CalculatorClientImpl"/>
<reference name="calculatorService"
target="CalculatorServiceComponent"/>
</component>
<component name="CalculatorServiceComponent">
<implementation.java class="calculator.CalculatorServiceImpl"/>
<reference name="ProvaWSService" target="ProvaWSService"/>
and the wsdl of jax-ws web services generated with Netbeans 6.7:
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. -->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://prova.netbureau.it/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://prova.netbureau.it/" name="provaWSService">
<types>
<xsd:schema>
<xsd:import namespace="http://prova.netbureau.it/"
schemaLocation="http://localhost:8080/ProvaWS/provaWS?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="addws">
<part name="parameters" element="tns:addws"></part>
</message>
<message name="addwsResponse">
<part name="parameters" element="tns:addwsResponse"></part>
</message>
<portType name="provaWS">
<operation name="addws">
<input message="tns:addws"></input>
<output message="tns:addwsResponse"></output>
</operation>
</portType>
<binding name="provaWSPortBinding" type="tns:provaWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"></soap:binding>
<operation name="addws">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="provaWSService">
<port name="provaWSPort" binding="tns:provaWSPortBinding">
<soap:address location="http://localhost:8080/ProvaWS/provaWS"></soap:address>
</port>
</service>
</definitions>
</component>
the reference was passed :
private ProvaWS ProvaWS;
@Reference
public void setCalculatorService(ProvaWS ProvaWS) {
this.ProvaWS = ProvaWS;
}
why can't get implementation class? I haven't the web service class relative to
port type definition in my classes packages but i have generated interface and
other java artifact with netbeans ws import (the web service is remote into
Tomcat 6.0.18 and tomcat was running)
anybody can help me, there is something wrong?
thank you very much
Roby
---------- Initial Header -----------
>From : "Raymond Feng" [email protected]
To : [email protected]
Cc :
Date : Fri, 16 Oct 2009 09:41:22 -0700
Subject : Re: reference to jax-ws external web service (calling it)
> Thanks for the detail steps. They are really helpful.
>
> Raymond
> --------------------------------------------------
> From: "Phillips, Chad" <[email protected]>
> Sent: Friday, October 16, 2009 8:47 AM
> To: <[email protected]>
> Subject: RE: reference to jax-ws external web service (calling it)
>
> > Raymond beat me to it but since I already wrote most of this up, here are
> > the steps that I've used in the past (these are the same things used by
> > the sample that Raymond is referring to):
> >
> > 1.) Get the WSDL for the service you want to access
> > 2.) Run wsimport on the WSDL
> > 3.) Add an attribute (for the reference) to your component of the service
> > interface type that was generated via wsimport and use the Reference
> > annotation. So something like:
> >
> > import org.osoa.sca.annotations.Reference;
> > import com.ext.FooService;
> >
> > public class SomeComponent implements SomeService {
> > @Reference
> > protected FooService fooService;
> > ...
> > }
> >
> > 4.) Add the reference info to the component in your .composite file:
> >
> > <component name="SomeComponent">
> > <implementation.java class="bar.SomeComponent" />
> > <reference name="fooService">
> > <binding.ws
> > wsdlElement="http://ext.com#wsdl.port(SvcName/PortName)"
> > uri="http://somehost/FooService" />
> > </reference>
> > </component>
> >
> > So, when your composite app loads up, the runtime will take care of
> > populating the reference with a valid WS client pointing to the endpoint
> > specified in your .composite file. If you leave off the uri attribute, I
> > believe whatever endpoint was specified in the original WSDL will be used.
> >
> > -----Original Message-----
> > From: Raymond Feng [mailto:[email protected]]
> > Sent: Friday, October 16, 2009 08:41
> > To: user
> > Subject: Re: reference to jax-ws external web service (calling it)
> >
> > Please take a look at the sample at [1]. It uses "wsimport" to generate
> > java
> > interfaces from a WSDL, and use it to talk to external weather WS using
> > Tuscany SCA.
> >
> > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> > xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
> > targetNamespace="http://weather" name="WeatherForecast">
> > <component name="WeatherForecastService">
> > <implementation.java class="weather.WeatherForecastImpl" />
> > <reference name="weatherForecast">
> > <binding.ws
> > wsdlElement="http://www.webservicex.net#wsdl.port(WeatherForecast/WeatherForecastSoap)"
> > />
> > </reference>
> > </component>
> > </composite>
> >
> > Please note binding.ws is used.
> >
> > [1]
> > https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/zipcode-jaxws/
> >
> > Thanks,
> > Raymond
> > --------------------------------------------------
> > From: <[email protected]>
> > Sent: Friday, October 16, 2009 7:42 AM
> > To: "user" <[email protected]>
> > Subject: reference to jax-ws external web service (calling it)
> >
> >> Hi,
> >>
> >> i used tuscany but i have not found the right directions how to call an
> >> external web service.. first of all, my question is:
> >>
> >> can an external webservices implemented in JAX-WS be used as components
> >> in
> >> a SCA architecture (or this is right only for bpel process and SCA pure
> >> java classes)?
> >>
> >> if it's so, how can pass a jax-ws reference in a SCA java class and call
> >> it? i see the document:
> >> http://www.osoa.org/display/Main/JAX-WS+Services+Integration
> >> but the jaxws.implementation doesn't work
> >> (tuscany give me:
> >>
> >> GRAVE: XMLSchema validation error occured in: Calculator.composite ,line
> >> =
> >> 63, column = 9, Message = cvc-complex-type.2.4.a: Invalid content was
> >> found starting with element 'implementation.jaxws'
> >>
> >> Somebody told me that in 2008 this implementation didin't existed yet:
> >>
> >> http://mail-archives.apache.org/mod_mbox/tuscany-user/200801.mbox/%[email protected]%3e
> >>
> >> today?? there is something in tuscany that works?????
> >>
> >> 2)An idea could be: i can use the java artifact get by the wsimport
> >> utility (from wsdl to java code interfaces) and invoke my jax-ws web
> >> services into a pure java SCA class?
> >>
> >>
> >> thank you very much!
> >>
> >> Roby
> >>
>