Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I use Perl to test web services created by using apache AXIS, and never encountered problem. Yesterday I upgraded to AXIS2, and got some issue. Whether to use AXIS or AXIS2, is probably not the issue here. I suspect that it has something to do with SOAP::Lite's ability to (fully) support WSDL, or maybe a name space thing? I would like to know what other wise monk think.

The web service is a very simply one that came with AXIS2 installation, you call getVersion(), and it simply returns the version of the AXIS2 you use. Here is the WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns: +axis2="http://ws.apache.org/axis2" xmlns:mime="http://schemas.xmlsoap +.org/wsdl/mime/" xmlns:ns0="http://axisversion.sample/xsd" xmlns:soap +12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schem +as.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xm +lns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas. +xmlsoap.org/wsdl/soap/" targetNamespace="http://ws.apache.org/axis2"> +<wsdl:types><xs:schema xmlns:ns="http://axisversion.sample/xsd" targe +tNamespace="http://axisversion.sample/xsd" elementFormDefault="unqual +ified" attributeFormDefault="unqualified"> <xs:element name="getVersion"> <xs:complexType /> </xs:element> <xs:element name="getVersionResponse"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="return" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema></wsdl:types><wsdl:message name="getVersionMessage"> <wsdl:part element="ns0:getVersion" name="part1" /></wsdl:message> <wsdl:message name="getVersionResponse"><wsdl:part element="ns0:getVer +sionResponse" name="part1" /></wsdl:message> <wsdl:portType name="versionPortType"><wsdl:operation name="getVersion +"><wsdl:input message="axis2:getVersionMessage" /> <wsdl:output message="axis2:getVersionResponse" /></wsdl:operation></w +sdl:portType> <wsdl:binding type="axis2:versionPortType" name="versionSOAP11Binding" +> <soap:binding style="document" transport="http://schemas.xmlsoap.org/s +oap/http" /> <wsdl:operation name="getVersion"> <soap:operation style="document" soapAction="urn:getVersion" /> <wsdl:input><soap:body namespace="http://ws.apache.org/axis2" use="lit +eral" /> </wsdl:input><wsdl:output> <soap:body namespace="http://ws.apache.org/axis2" use="literal" /></ws +dl:output></wsdl:operation> </wsdl:binding> <wsdl:binding type="axis2:versionPortType" name="versionSOAP12Binding" +> <soap12:binding style="document" transport="http://schemas.xmlsoap.org +/soap/http" /> <wsdl:operation name="getVersion"><soap12:operation style="document" s +oapAction="urn:getVersion" /><wsdl:input> <soap12:body namespace="http://ws.apache.org/axis2" use="literal" /></ +wsdl:input><wsdl:output> <soap12:body namespace="http://ws.apache.org/axis2" use="literal" /></ +wsdl:output></wsdl:operation></wsdl:binding> <wsdl:binding type="axis2:versionPortType" name="versionHttpBinding"> <http:binding verb="POST" /><wsdl:operation name="getVersion"> <http:operation location="getVersion" /><wsdl:input><mime:content type +="text/xml" /> </wsdl:input><wsdl:output><mime:content type="text/xml" /></wsdl:outpu +t> </wsdl:operation></wsdl:binding><wsdl:service name="version"> <wsdl:port binding="axis2:versionSOAP11Binding" name="versionSOAP11por +t0"> <soap:address location="http://it-peip.owfg.com/axis2/services/version +:it-peip.owfg.com/axis2/services/version" /> </wsdl:port> <wsdl:port binding="axis2:versionSOAP12Binding" name="versionSOAP12por +t0"> <soap12:address location="http://it-peip.owfg.com/axis2/services/versi +on:it-peip.owfg.com/axis2/services/version" /> </wsdl:port> <wsdl:port binding="axis2:versionHttpBinding" name="versionHttpport0"> <http:address location="http://it-peip.owfg.com/axis2/rest/version:it- +peip.owfg.com/axis2/rest/version" /> </wsdl:port></wsdl:service></wsdl:definitions>

Here is the debug info from SOAP::Lite:

POST http://localhost:8080/axis2/services/version Accept: text/xml Accept: multipart/* Content-Length: 456 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:getVersion" <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schem +as.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap +.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOA +P-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body><namesp5:getVersion xmlns:namesp5="http://ws.apache.org +/axis2"/> </SOAP-ENV:Body></SOAP-ENV:Envelope> HTTP/1.1 500 Internal Server Error Connection: close Date: Tue, 16 May 2006 14:53:12 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Tue, 16 May 2006 14:53:13 GMT Client-Peer: 127.0.0.1:8080 Client-Response-Num: 1 Set-Cookie: JSESSIONID=586B63172F5551312E8E6A3EA41AE4E1; Path=/axis2 <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv= +"http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header /><soapen +v:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode> <faultstring>namespace mismatch require http://axisversion.sample/xsd +found http://ws.apache.org/axis2</faultstring> <detail><Exception>org.apache.axis2.AxisFault: namespace mismatch requ +ire http://axisversion.sample/xsd found http://ws.apache.org/axis2&#1 +3; at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusines +sLogic(RPCMessageReceiver.java:89)&#13; at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.rec +eive(AbstractInOutSyncMessageReceiver.java:37)&#13; at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454) +&#13; at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPP +ostRequest(HTTPTransportUtils.java:284)&#13; at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet. +java:136)&#13; at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)&#1 +3; at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)&#1 +3; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilte +r(ApplicationFilterChain.java:252)&#13; at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applic +ationFilterChain.java:173)&#13; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWr +apperValve.java:213)&#13; at org.apache.catalina.core.StandardContextValve.invoke(StandardCo +ntextValve.java:178)&#13; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostV +alve.java:126)&#13; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportV +alve.java:105)&#13; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEng +ineValve.java:107)&#13; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapt +er.java:148)&#13; at org.apache.coyote.http11.Http11Processor.process(Http11Processo +r.java:869)&#13; at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHan +dler.processConnection(Http11BaseProtocol.java:664)&#13; at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTc +pEndpoint.java:527)&#13; at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(Lea +derFollowerWorkerThread.java:80)&#13; at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(T +hreadPool.java:684)&#13; at java.lang.Thread.run(Unknown Source)&#13; </Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope +>

It says server internal error, but I doubt... I think SOAP::Lite has mishandled WSDL/name space under some condition.

Edited by planetscape - added readmore tags

( keep:0 edit:10 reap:0 )

Replies are listed 'Best First'.
Re: Problem with combination of SOAP::Lite and Apache AXIS2
by gellyfish (Monsignor) on May 17, 2006 at 10:11 UTC

    I might be reading the WSDL incorrectly but it looks very much like that this is where the problem lies. The actual error is:

    namespace mismatch require http:/ +/axisversion.sample/xsd found http://ws.apache.org/axis2
    and the client is indeed sending the latter namespace in the request:
    <namesp5:getVersion xmlns:namesp5="http://ws.apache.org/axis2"/>
    However it looks to me that the WSDL is actually telling it to do that:
    <wsdl:input><soap:body namespace="http://ws.apache.org/axis2" use="lit +eral" /> </wsdl:input>
    It might be possible to over-ride this with the uri method in the soap client but without seeing the client code it is difficult to comment further.

    /J\

      I doubt. Last night, I tried to write a AXIS client to call this service provided through AXIS2, and it worked. Now I clearly intend to believe that the problem is with SOAP::Lite.

      One of the problem with SOAP::Lite is that it was not developed according to a high standard. Reading the document, you will see that, there are many places saying things like "this is not supported, and that is not supported".

      For me, the solution is to get rid of Perl, and that's what I am going to do.

        I'm sure the authors of SOAP::Lite will be delighted with your patches.

        I'm not quite sure what your beef is, you have ignored my inquiry as to what your client code looked like and simply decided that SOAP::Lite doesn't work at all.

        I think there is a problem with parsing the WSDL that axis2 generates, but this is partially because it exercises a number of features that are axis specific. Anyhow SOAP::Lite will work fine with that service (and I have installed axis2 to test this), this code works as expected for me:

        use SOAP::Lite; + my $soap = SOAP::Lite->new(); + $soap->uri('http://axisversion.sample/xsd'); $soap->service('http://localhost:8080/axis2/services/version?wsdl'); + + print $soap->getVersion();

        /J\

Re: Problem with combination of SOAP::Lite and Apache AXIS2
by Anonymous Monk on May 22, 2006 at 19:34 UTC
    SUN's JWSDP 2.0 worked with AXIS2.
A reply falls below the community's threshold of quality. You may see it by logging in.