I don't know if this is the problem, but the name attribute is required on all <input> and <output> definitions in the WSDL (in <port> and <binding>).
Anne On 8/10/05, Anthoni Tom <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" > xmlns:tns="http://www.kzen.be/axis2" > targetNamespace="http://www.kzen.be/axis2"> > > <types> > > <xs:schema > targetNamespace="http://www.kzen.be/axis2"> > > <xs:complexType > name="testOperationType"> > > > <xs:sequence> > > > <xs:element name="testOperationString" type="xs:string"/> > > > </xs:sequence> > > </xs:complexType> > > <xs:element > name="testOperationElement" type="tns:testOperationType"/> > > </xs:schema> > > </types> > > <message name="testOperationRequest"> > > <part name="parameter" > element="tns:testOperationElement"/> > > </message> > > <message name="testOperationResponse"> > > <part name="result" > element="tns:testOperationElement"/> > > </message> > > <portType name="TestAxisS"> > > <operation name="testOperation"> > > <input > message="tns:testOperationRequest"/> > > <output > message="tns:testOperationResponse"/> > > </operation> > > </portType> > > <binding name="TestAxisSBinding" type="tns:TestAxisS"> > > <soap:binding style="document" > transport="http://schemas.xmlsoap.org/soap/http"/> > > <operation name="testOperation"> > > <soap:operation > soapAction="testOperation" style="document"/> > > <input> > > <soap:body > use="literal"/> > > </input> > > <output> > > <soap:body > use="literal"/> > > </output> > > </operation> > > </binding> > > <service name="TestAxisService"> > > <port name="tns:TestAxisSport" > binding="tns:TestAxisSBinding"> > > <soap:address > location="REPLACE_WITH_ACTUAL_URL"/> > > </port> > > </service> > > </definitions> > > > > > > This is the wsdl. It has one simple operation that receives a string and > replies the same string followed with a "!". > > I then used WSDL2java > > > > call WSDL2Java -uri wsdl\TestAxisService.wsdl -a -ss -sd -o src -p > be.kzen.axis2.testaxisservice > > > > TestAxisSSkeleton.java of the webservice (server side): this simple code: > > > > TestOperationElementDocument output = > TestOperationElementDocument.Factory.newInstance(); > > TestOperationType inType = > param0.getTestOperationElement(); > > TestOperationType outType = > TestOperationType.Factory.newInstance(); > > > > // output string = input string with "!!!" > > > outType.setTestOperationString(inType.getTestOperationString() + "!!!"); > > > > output.setTestOperationElement(outType); > > return output; > > > > On the client side I call this webservice with the following code: > > > > Call call = new Call(); > > call.setTo(targetEPR); > > call.engageModule(new > QName(Constants.MODULE_ADDRESSING)); > > call.setTransportInfo(Constants.TRANSPORT_HTTP, > Constants.TRANSPORT_HTTP, true); > > //Callback to handle the response (just print the > result) > > Callback callback = new CallBackImpl(); > > //Non-Blocking Invocation > > call.invokeNonBlocking("testOperation", payload, > callback); > > > > I hope this is complete… > > Thanks in advance for the effort! > > > > Kind regards, > > Tom Anthoni > > > > > > ________________________________ > > > From: Eran Chinthaka [mailto:[EMAIL PROTECTED] > Sent: woensdag 10 augustus 2005 10:57 > To: [email protected] > Subject: RE: [axis2] invoking webservice > > > > > Sounds familiar. > > > > Seems like the envelope element is missing from the OUT message. > > > > If you generated the code from WSDL2JAVA, send us the WSDL > > Else if you wrote the client yourself, send the client code. > > > > -- Chinthaka > > > ________________________________ > > > From: Anthoni Tom [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 10, 2005 2:45 PM > To: [email protected] > Subject: [axis2] invoking webservice > > > > I'm invoking a webservice I deployed. > > This is the error: > > > > org.apache.axis2.engine.AxisFault: First Element must > contain the local name, Envelope; nested exception is: > > org.apache.axis2.om.OMException: First Element must contain the > local name, Envelope > > at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:83) > > at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:44) > > at > org.apache.axis2.clientapi.TwoChannelBasedSender.send(TwoChannelBasedSender.java:49) > > at > org.apache.axis2.clientapi.InOutMEPClient$NonBlockingInvocationWorker.doWork(InOutMEPClient.java:338) > > at > org.apache.axis2.util.threadpool.ThreadWorker.run(ThreadWorker.java:34) > > Caused by: org.apache.axis2.om.OMException: First Element must contain the > local name, Envelope > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:193) > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:164) > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.next(StAXSOAPModelBuilder.java:302) > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:149) > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.identifySOAPVersion(StAXSOAPModelBuilder.java:104) > > at > org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:91) > > at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:78) > > ... 4 more > > > > Sounds familiar for anyone? > > > > (I'm invokingnonblocking) > > > > Kind regards, > > Tom Anthoni
