Hi, thanks for replay. I'm using Axis 1.4, and I dind't use any automatic tool to generate java code. I found the code on a tutorial on line. the tutorial was related to interface a traslator web service. So I adapted it to interface to HelloWorld web service. Anyway I'm trying to generate a client to talk to the hello world web service exposes by SCA.
Thanks for all ---------- Initial Header ----------- >From : "Raymond Feng" [EMAIL PROTECTED] To : "user" [email protected] Cc : Date : Mon, 10 Nov 2008 08:55:30 -0800 Subject : Re: wsa action > Hi, > > Are you trying to use an Axis2 generated client to talk to the helloworld Web > Service > exposed by SCAS ? Which WSDL2Java tool did you use to generate the client? > > Thanks, > Raymond > > -------------------------------------------------- > From: "Marco Piccinni" <[EMAIL PROTECTED]> > Sent: Monday, November 10, 2008 5:35 AM > To: "user" <[email protected]> > Subject: wsa action > > > Hi all! > > > > I'm trying to generate a web application to consume the helloworld > > service. I used the tutorial online and that's the composite: > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" > > xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" > > xmlns:c="http://helloworld" > > targetNamespace="http://helloworld" > > name="helloworld"> > > > > <component name="HelloWorldComponent"> > > <implementation.java class="helloworld.HelloWorldImpl"/> > > <service name="HelloWorld"> > > <binding.ws uri="http://localhost:9090/HelloWorld"/> > > </service> > > </component> > > </composite> > > > > > > and tht's the code I use to interface the wsdl generated on this composite > > by tuscany plugin: > > > > > > package model; > > > > import java.net.*; > > import java.util.*; > > import org.apache.soap.*; > > import org.apache.soap.rpc.*; > > > > > > public class prova { > > > > public prova() { > > > > } > > public String connessione() throws SOAPException, MalformedURLException { > > // creo un oggetto soap di tipo call per effettuare la chiamata > > Call call = new Call (); > > URL url; > > > > > > //setto dentro la call di soap l'identificativo del servizio > > // call.setTargetObjectURI("urn:xmethodsBabelFish"); > > > > //dichiaro a quale url รจ in ascolto il servizio > > url= new URL("http://localhost:9090/HelloWorld"); > > Vector param = new Vector (); > > > > //secondo il meccanismo di soap serializzo le informazioni da inviare > > dentro ad un vettore > > param.addElement (new Parameter("name", String.class, "Marco", null)); > > // param.addElement (new Parameter("sourcedata", > > String.class,sourcedata, null)); > > call.setParams (param); > > > > //indico alla chiamata quale metodo invocare remotamente > > call.setMethodName ("sayHello"); > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); > > > > //invoco il web service ed attendo la risposta > > Response result = call.invoke (url, ""); > > > > //controllo se la risposta contiene degli errori > > if (result.generatedFault ()) > > { > > Fault fault = result.getFault(); > > throw new SOAPException(fault.getFaultCode(), > > fault.getFaultString()); > > } > > Parameter retValue = result.getReturnValue(); > > //ritorno castando a stringa il valore di ritorno dalla risposta > > if (retValue != null) return (String)retValue.getValue (); > > return "OPERAZIONE RIUSCITA"; > > > > } > > > > } > > > > This code is contained in a class wich methods are called by a jsp. > > > > I create a .war file a I put it into the webapp tomcat folder: I obtain > > this message: > > > > The endpoint reference (EPR) for the Operation not found is > > http://localhost:9090/HelloWorld and the WSA Action = > > > > What does it mean? > > > > If it could help the wsdl generated by tuscany plugin follow here: > > > > <wsdl:definitions name="HelloWorldService" > > targetNamespace="http://helloworld/"> > > - > > <wsdl:types> > > - > > <xs:schema attributeFormDefault="qualified" > > elementFormDefault="unqualified" targetNamespace="http://helloworld/"> > > - > > <xs:element name="sayHelloResponse"> > > - > > <xs:complexType> > > - > > <xs:sequence> > > <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > - > > <xs:element name="sayHello"> > > - > > <xs:complexType> > > - > > <xs:sequence> > > <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > </xs:schema> > > </wsdl:types> > > - > > <wsdl:message name="sayHelloResponse"> > > <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse"> > > </wsdl:part> > > </wsdl:message> > > - > > <wsdl:message name="sayHello"> > > <wsdl:part name="sayHello" element="tns:sayHello"> > > </wsdl:part> > > </wsdl:message> > > - > > <wsdl:portType name="HelloWorld"> > > - > > <wsdl:operation name="sayHello"> > > <wsdl:input message="tns:sayHello"> > > </wsdl:input> > > <wsdl:output message="tns:sayHelloResponse"> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:portType> > > - > > <wsdl:binding name="HelloWorldBinding" type="tns:HelloWorld"> > > <SOAP:binding style="document" > > transport="http://schemas.xmlsoap.org/soap/http"/> > > - > > <wsdl:operation name="sayHello"> > > <SOAP:operation/> > > - > > <wsdl:input> > > <SOAP:body use="literal"/> > > </wsdl:input> > > - > > <wsdl:output> > > <SOAP:body use="literal"/> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:binding> > > - > > <wsdl:service name="HelloWorldService"> > > - > > <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding"> > > <SOAP:address location="http://10.10.4.236:9090/HelloWorld"/> > > </wsdl:port> > > </wsdl:service> > > </wsdl:definitions> > > > > Thanks to all!! > > > > Marco Piccinni > > >
