[xgws-user] WSIF Dyn. Invoker with Axis2
Aleksander Slominski
aslom_at_cs.indiana.edu
Thu, 16 Nov 2006 13:58:49 -0500
Andre P. wrote:
> Hello Alek!!! Thanks (again) for the answer!!!
> I'm pretty confused with this Axis2 stuff ! Yes, that AddService was
> not including the right input parameters! I'll send that to axis-dev!
hi Andre,
i think they should be able to provide the *authoritative* answer on
that (and point to documentation/samples/etc)
> But now I created now a really simple service, and even this one is
> getting a fault, and I'm not finding the problem in the WSDL (it seems
> fine to me, i altered). It seems that XSUL is not dealing with some
> WS-Addressing tags!
> I'm attaching it to you, including the messages I get from the xsul
> tracer!
i will look into that - could you send me what AXIS2 client sends to
AXIS2 service (or to XSUL service)? os i can see what it expects in
wsa:Action.
thanks,
alek
>
>
> On 11/14/06, * Aleksander Slominski* <aslom_at_cs.indiana.edu
> <mailto:aslom_at_cs.indiana.edu>> wrote:
>
> Andre P. wrote:
> > Hello list!
> >
> > Has anybody worked with XSUL Dynamic Invoker with Axis2, and faced
> > some problems when invoking the SOAP (and not the REST :) services?
> > I used to work with Axis 1, and everything works fine with Dyn.
> > Invoker, but I seems that there is a lot of differences between
> Axis 1
> > and 2.
> > I tried to change in the services.xml the class
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver to
> > org.apache.axis2.receivers.RawXMLINOutMessageReceiver but I didn't
> > work too.
> >
> > Anyone experienced the same problems? I guess maybe it's
> something in
> > the code of my service, so I'm attaching it, with also the WSDL
> > (auto-generated by AXIS2), and my .AAR file (that I deployed in
> Axis2).
> your WSDL does nto really corresppond to code in MyAddService (which
> expects two elements with string inside that are representing integer
> numbers and returns element called "result" not "return" and type of
> element should be xsd:int not anyType
>
> you should send this question to axis-dev.
>
> best,
>
> alek
> >
> > Thanks in advance for any help!
> >
> > Best regards,
> >
> > Andre
> >
> >
> ------------------------------------------------------------------------
> >
> > <wsdl:definitions targetNamespace="http://ws.apache.org/axis2">
> > <wsdl:documentation>AddService</wsdl:documentation>
> >
> > <wsdl:types>
> >
> > <xs:schema attributeFormDefault="qualified"
> elementFormDefault="qualified" targetNamespace="
> http://ws.apache.org/axis2/xsd">
> >
> > <xs:element name="add">
> >
> > <xs:complexType>
> >
> > <xs:sequence>
> > <xs:element name="param0" nillable="true" type="xs:anyType"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> >
> > <xs:element name="addResponse">
> >
> > <xs:complexType>
> >
> > <xs:sequence>
> > <xs:element name="return" nillable="true" type="xs:anyType"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> > </wsdl:types>
> >
> > <wsdl:message name="addMessage">
> > <wsdl:part name="part1" element="ns0:add"/>
> > </wsdl:message>
> >
> > <wsdl:message name="addResponse">
> > <wsdl:part name="part1" element="ns0:addResponse"/>
> > </wsdl:message>
> >
> > <wsdl:portType name="AddServicePortType">
> >
> > <wsdl:operation name="add">
> > <wsdl:input message="axis2:addMessage" wsaw:Action="urn:add"/>
> > <wsdl:output message="axis2:addResponse"/>
> > </wsdl:operation>
> > </wsdl:portType>
> >
> > <wsdl:binding name="AddServiceSOAP11Binding"
> type="axis2:AddServicePortType">
> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
> >
> > <wsdl:operation name="add">
> > <soap:operation soapAction="urn:add" style="document"/>
> >
> > <wsdl:input>
> > <soap:body use="literal"/>
> > </wsdl:input>
> >
> > <wsdl:output>
> > <soap:body use="literal"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> >
> > <wsdl:binding name="AddServiceSOAP12Binding"
> type="axis2:AddServicePortType">
> > <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
> >
> > <wsdl:operation name="add">
> > <soap12:operation soapAction="urn:add" style="document"/>
> >
> > <wsdl:input>
> > <soap12:body use="literal"/>
> > </wsdl:input>
> >
> > <wsdl:output>
> > <soap12:body use="literal"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> >
> > <wsdl:binding name="AddServiceHttpBinding"
> type="axis2:AddServicePortType">
> > <http:binding verb="POST"/>
> >
> > <wsdl:operation name="add">
> > <http:operation location="add"/>
> >
> > <wsdl:input>
> > <mime:content type="text/xml"/>
> > </wsdl:input>
> >
> > <wsdl:output>
> > <mime:content type="text/xml"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> >
> > <wsdl:service name="AddService">
> >
> > <wsdl:port name="AddServiceSOAP11port_http"
> binding="axis2:AddServiceSOAP11Binding">
> > <soap:address location="
> http://localhost:8080/axis2/services/AddService"/>
> > </wsdl:port>
> >
> > <wsdl:port name="AddServiceSOAP12port_http"
> binding="axis2:AddServiceSOAP12Binding">
> > <soap12:address
> location="http://localhost:8080/axis2/services/AddService"/>
> > </wsdl:port>
> >
> > <wsdl:port name="AddServiceHttpport1"
> binding="axis2:AddServiceHttpBinding">
> > <http:address
> location="http://localhost:8080/axis2/rest/AddService"/>
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> >
> ------------------------------------------------------------------------
> >
> > import java.util.Iterator;
> > import org.apache.axiom.om.*;
> >
> > public class MyAddService
> > {
> >
> > public MyAddService()
> > {
> > }
> >
> > public OMElement add(OMElement omelement)
> > {
> > Iterator iterator = omelement.getChildElements();
> > String s = ((OMElement)iterator.next()).getText();
> > String s1 = ((OMElement)iterator.next()).getText();
> > int i = Integer.parseInt(s);
> > int j = Integer.parseInt(s1);
> > int k = i + j;
> > OMFactory omfactory = OMAbstractFactory.getOMFactory();
> > org.apache.axiom.om.OMNamespace omnamespace =
> omfactory.createOMNamespace("http://axis2/test/namespace1", "ns1");
> > OMElement omelement1 =
> omfactory.createOMElement("result", omnamespace);
> > omelement1.setText(Integer.toString(k));
> > return omelement1;
> > }
> > }
>
>
> --
> The best way to predict the future is to invent it - Alan Kay
>
>
> ------------------------------------------------------------------------
>
> public class Test {
> public String doTest () throws Exception {
> return "Tested OK!";
> }
> }
> ------------------------------------------------------------------------
>
> MLogger $Revision: 1.8 $ $Date: 2005/02/16 05:52:51 $ (GMT) configured as ':ALL' (XSUL version compile-time:2.7.9 runtime:2.7.16)
> [ 17:40:20.562 main: xsul.wsif.impl.WSIFMessageElement.java:89 addPlaceholderForParameters 5] elementPartQName={http://ws.apache.org/axis2/xsd}doTestResponse
> [ 17:40:20.578 main: xsul.wsif.impl.WSIFMessageElement.java:253 addListOfElementNames 3] adding sequence element type name=return typeQName={http://www.w3.org/2001/XMLSchema}string
> [ 17:40:20.640 main: xsul.wsif.impl.WSIFMessageElement.java:260 addListOfElementNames 3] adding sequence element name=return
> [ 17:40:20.640 main: xsul.wsif.impl.WSIFMessageElement.java:178 addPlaceholderForParameters 1] name=return
> [ 17:40:20.640 main: xsul.wsif.impl.WSIFMessageElement.java:190 addPlaceholderForParameters 5] special messageIn=<n1:doTestResponse xmlns:n1="http://ws.apache.org/axis2/xsd"><n1:return /></n1:doTestResponse>
> [ 17:40:20.640 main: xsul.wsif.impl.WSIFMessageElement.java:201 addPlaceholderForParameters 5] messageIn=<n1:doTestResponse xmlns:n1="http://ws.apache.org/axis2/xsd"><n1:return /></n1:doTestResponse>
> [ 17:40:20.656 main: xsul.invoker.http.HttpDynamicInfosetInvoker.java:248 invokeXml 1] host=localhost port=8080 secure=false
> [ 17:40:20.656 main: xsul.http_client.plain_impl.PlainClientSocketFactory.java:45 connect 1] connect localhost:8080 timeout:240000
> [ 17:40:20.734 main: trace.xsul.http.client.out xsul.http_client.HttpClientRequest.java:244 writeHeaders 1] TRACE: sending request headers:---
> POST /axis2/services/TestService HTTP/1.0\r
> Host: localhost:8080\r
> User-Agent: XSUL/2.7.16\r
> Content-Type: text/xml; charset=utf-8\r
> Content-Length: 527\r
> Keep-Alive: 300\r
> SOAPAction: \"urn:doTest\"\r
> Connection: keep-alive\r
> \r
> ---
>
> [ 17:40:20.734 main: trace.xsul.http.client.out xsul.http_client.HttpClientRequest.java:284 closeRequest 1] TRACE: sending request body:---
> <?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wsa='http://www.w3.org/2005/08/addressing' xmlns:wsp='http://schemas.xmlsoap.org/ws/2002/12/policy' xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Header><wsa:To>http://localhost:8080/axis2/services/TestService</wsa:To><wsa:Action>http://ws.apache.org/axis2/TestServicePortType/doTest</wsa:Action></S:Header><S:Body><doTestMessage /></S:Body></S:Envelope>---
>
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:112 readStatusLine 1] HTTP/1.1 500 Internal Server Error
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1] Server: Apache-Coyote/1.1
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1] Set-Cookie: JSESSIONID=6B0A5DBFDDB941CCF3E26F84685A4A33; Path=/axis2
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1] Content-Type: text/xml;charset=utf-8
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1] Date: Thu, 16 Nov 2006 17:42:08 GMT
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1] Connection: close
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:200 readHeaders 1]
> [ 17:40:20.750 main: trace.xsul.http.client.in xsul.http_client.HttpClientResponse.java:389 getBodyInputStream 1] TRACE: received response:---
> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address></wsa:ReplyTo><wsa:MessageID>urn:uuid:9747EA8987DA3A8EB511636989285877</wsa:MessageID><wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action><wsa:FaultDetail><wsa:ProblemHeaderQName>wsa:Action</wsa:ProblemHeaderQName></wsa:FaultDetail></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>wsa:InvalidAddressingHeader</faultcode><faultstring>A header representing a Message Addressing Property is not valid and the message cannot be processed</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>---
>
> [ 17:40:20.765 main: xsul.invoker.soap_over_http.SoapHttpDynamicInfosetInvoker.java:91 extractBodyContent 1] resp doc: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address></wsa:ReplyTo><wsa:MessageID>urn:uuid:9747EA8987DA3A8EB511636989285877</wsa:MessageID><wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action><wsa:FaultDetail><wsa:ProblemHeaderQName>wsa:Action</wsa:ProblemHeaderQName></wsa:FaultDetail></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>wsa:InvalidAddressingHeader</faultcode><faultstring>A header representing a Message Addressing Property is not valid and the message cannot be processed</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
> [ 17:40:20.765 main: xsul.invoker.soap_over_http.SoapHttpDynamicInfosetInvoker.java:96 extractBodyContent 1] content xml: <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>wsa:InvalidAddressingHeader</faultcode><faultstring>A header representing a Message Addressing Property is not valid and the message cannot be processed</faultstring><detail /></soapenv:Fault>
> received fault:
> <detail />
>
> ------------------------------------------------------------------------
>
> <wsdl:definitions xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:ns0="http://ws.apache.org/axis2/xsd"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:ns1="http://org.apache.axis2/xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> targetNamespace="http://ws.apache.org/axis2">
>
> <wsdl:documentation>TestService</wsdl:documentation>
>
> <wsdl:types>
> <xs:schema xmlns:ns="http://ws.apache.org/axis2/xsd" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2/xsd">
> <xs:element name="doTestResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="return" minOccurs="1" maxOccurs="1" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="doTestFault">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="doTestFault" type="xs:anyType"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> </wsdl:types>
>
> <wsdl:message name="doTestMessage"/>
>
> <wsdl:message name="doTestResponse">
> <wsdl:part name="part1" element="ns0:doTestResponse"/>
> </wsdl:message>
>
> <wsdl:message name="doTestFault">
> <wsdl:part name="part1" element="ns0:doTestFault"/>
> </wsdl:message>
>
> <wsdl:portType name="TestServicePortType">
> <wsdl:operation name="doTest">
> <wsdl:input message="axis2:doTestMessage" />
> <wsdl:output message="axis2:doTestResponse"/>
> <wsdl:fault message="axis2:doTestFault" name="doTestFault"/>
> </wsdl:operation>
> </wsdl:portType>
>
> <wsdl:binding name="TestServiceSOAP11Binding" type="axis2:TestServicePortType">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
> <wsdl:operation name="doTest">
> <soap:operation soapAction="urn:doTest" style="document"/>
> <wsdl:input>
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="doTestFault">
> <soap:body use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:binding name="TestServiceSOAP12Binding" type="axis2:TestServicePortType">
> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
> <wsdl:operation name="doTest">
> <soap12:operation soapAction="urn:doTest" style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="doTestFault">
> <soap12:fault use="literal" name="doTestFault"/>
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:binding name="TestServiceHttpBinding" type="axis2:TestServicePortType">
> <http:binding verb="POST"/>
> <wsdl:operation name="doTest">
> <http:operation location="doTest"/>
> <wsdl:input>
> <mime:content type="text/xml"/>
> </wsdl:input>
> <wsdl:output>
> <mime:content type="text/xml"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:service name="TestService">
> <wsdl:port name="TestServiceSOAP11port_http" binding="axis2:TestServiceSOAP11Binding">
> <soap:address location="http://localhost:8080/axis2/services/TestService"/>
> </wsdl:port>
> <wsdl:port name="TestServiceSOAP12port_http" binding="axis2:TestServiceSOAP12Binding">
> <soap12:address location="http://localhost:8080/axis2/services/TestService"/>
> </wsdl:port>
> <wsdl:port name="TestServiceHttpport1" binding="axis2:TestServiceHttpBinding">
> <http:address location="http://localhost:8080/axis2/rest/TestService"/>
> </wsdl:port>
> </wsdl:service>
>
> </wsdl:definitions>
--
The best way to predict the future is to invent it - Alan Kay