Now i have this kind of problem give me by tuscany:

GRAVE: Reference not found for component reference: Component = ProvaWSService 
Reference = ProvaWSService
21-ott-2009 11.15.35 
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
GRAVE: Reference not found for component reference: Component = ProvaWSService 
Reference = ProvaWSService
21-ott-2009 11.15.35 
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
AVVERTENZA: No targets for reference: Composite = {http://sample}Calculator 
Reference = ProvaWS
21-ott-2009 11.15.35 
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceEndpointReferenceBuilderImpl
AVVERTENZA: No targets for reference: Composite = {http://sample}Calculator 
Reference = ProvaWS
21-ott-2009 11.15.35 
org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator
AVVERTENZA: Unable to generate WSDL for ProvaWSService/ProvaWSService
21-ott-2009 11.15.35 
org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator
GRAVE: No interface contract for ProvaWSService/ProvaWSService
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

What's wrong

i semplified my project.. I have an exteernal webservice running in tomcat with 
class ProvaWs that contain a webmethod. Interface generated by wsimport is 
ProvaWs and the Service is ProvaWsservice

this mean that i have a client with jax-ws, i get service instance x and 
x.getProvaWsPort() give me the stub class (remote class ProvaWs) whose 
interface is ProvaWs. Calling then remote method add(@WebMethod definition).

I add this: A ProvaWsImpl class that implements ProvaWs interface (linke in 
Wehater ws example: 
https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/zipcode-jaxws/).
This is my composite:

<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903";
           targetNamespace="http://sample";
           xmlns:sample="http://sample";
           xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance";
           name="Calculator">


<!-- external web service JAX-WS -->
<component name="ProvaWSService">
        <implementation.java
          class="it.netbureau.prova.ProvaWSImpl"/>
        <reference name="ProvaWSService">
           <binding.ws
                wsdlElement="http://prova.netbureau.it
                 /#wsdl.port(provaWSService/provaWSPort)"
                 wsdli:wsdlLocation="http://localhost:8080
                 /ProvaWS/provaWS?wsdl"/>
        </reference>
    </component>

</composite>

I pass my reference in :

@Service(ProvaWS.class)
public class ProvaWSImpl implements ProvaWS{

    @Reference
    public ProvaWS ProvaWS;

    public Integer addws(int num1, int num2) {
        return ProvaWS.addws(num1, num2);
    }

What's wrong? I should implement an interface also for ProvaWsService??? :| :(

thank you!
Roby


---------- Initial Header -----------

>From      : "Raymond Feng" enjoyj...@gmail.com
To          : user@tuscany.apache.org
Cc          :
Date      : Mon, 19 Oct 2009 08:30:28 -0700
Subject : Re: reference to jax-ws external web service (calling it)







> wsdl.port take the WSDL service name and port name. It's not port type.
>
> --------------------------------------------------
> From: <ytrewq2...@libero.it>
> Sent: Monday, October 19, 2009 6:40 AM
> To: "user" <user@tuscany.apache.org>
> Cc: "user" <user@tuscany.apache.org>
> Subject: Re: reference to jax-ws external web service (calling it)
>
> > Excuse me,
> >
> > wsdlElement="http://ext.com#wsdl.port(SvcName/PortName)"
> >
> > PortName is the PortType or the Port name??
> >
> > so this is wrong? (it tells port type not port name):
> >
> > http://frascati.ow2.org/doc/1.0/ch04s03.html
> >
> > thank you
> >
> > ---------- Initial Header -----------
> >
> > From      : "Raymond Feng" enjoyj...@gmail.com
> > To          : user@tuscany.apache.org
> > 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" <chad.phill...@gdit.com>
> >> Sent: Friday, October 16, 2009 8:47 AM
> >> To: <user@tuscany.apache.org>
> >> 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:enjoyj...@gmail.com]
> >> > 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: <ytrewq2...@libero.it>
> >> > Sent: Friday, October 16, 2009 7:42 AM
> >> > To: "user" <user@tuscany.apache.org>
> >> > 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/%3c477b78b1.6050...@hursley.ibm.com%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
> >> >>
> >>
> >
>

Reply via email to