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 )


In reply to Problem with combination of SOAP::Lite and Apache AXIS2 by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.