Hi, Guys, I have small question. How to authenticate using WSDL2Java in Axis2 ?
I can see command line arguments in Axis(old) version of WSDL2Java but could see anything in Axis2 implementation? Thanks in advance for help. Regards Amit 30, Hudson St. Goldman Sachs PH: 212 902 0395 "Willing to learn what you are willing to share." -----Original Message----- From: Eran Chinthaka [mailto:[EMAIL PROTECTED] Sent: Monday, August 21, 2006 5:04 AM To: [email protected] Subject: Re: Perl SOAP::Lite and Apache Axis2 interoperability Hi Aleksy, As I predicted, the SOAP ns URI of the request you are sending is wrong. It should be either of http://schemas.xmlsoap.org/soap/envelope/ - for SOAP 1.1 or http://www.w3.org/2003/05/soap-envelope - for SOAP 1.2. But in your request it is xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/. Please check this with SOAPLite dev list. HTH. -- Chinthaka Aleksey Serba wrote: > Hi Eran, > > I'm trying to make a soap call using wsdl. > > 1. Axis2 version client: > > Usу stubmaker: > sh> stubmaker.pl 'http://localhost/axis2/services/version?wsdl' > > or dynamically: > versionclient.pl > ------------------------ > use SOAP::Lite; > use Data::Dumper; > my $result = SOAP::Lite -> > service('http://localhost/axis2/services/version?wsdl') -> > getVersion(); print Dumper($result); > ------------------------ > > In both cases my script failed with error "Can't call method "element" > on an undefined value at /usr/local/share/perl/5.8.8/SOAP/Lite.pm line > 2845." > > 2. Test echo service > I've build simple echo service, package it into aar and deploy to axis2. > Service wsdl > ---------------------------------------------------------------------- > -------------------- > > <wsdl:definitions xmlns:axis2="http://ws.apache.org/axis2" > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" > xmlns:ns0="http://test.axis2.ws.apache.org/xsd" > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > 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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > Test Echo service > </wsdl:documentation> > <wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <xs:schema xmlns:stn_2="http://test.axis2.ws.apache.org/xsd" > xmlns:axis2="http://ws.apache.org/axis2" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:ns0="http://test.axis2.ws.apache.org/xsd" > xmlns:ns1="http://org.apache.axis2/xsd" > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://test.axis2.ws.apache.org/xsd"> > <xs:element name="echo"> > <xs:complexType> > <xs:sequence> > <xs:element name="string" type="xs:string" /> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:element name="echoResponse"> > <xs:complexType> > <xs:sequence> > <xs:element name="return" type="xs:string" /> > </xs:sequence> > </xs:complexType> > > </xs:element> > </xs:schema> > </wsdl:types> > <wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echoMessage"> > <wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="part1" element="ns0:echo" /> > </wsdl:message> > <wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echoResponse"> > <wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="part1" element="ns0:echoResponse" /> > </wsdl:message> > <wsdl:portType xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoPortType"> > <wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echo"> > <wsdl:input > xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > message="axis2:echoMessage" wsaw:Action="urn:echo" /> > <wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > message="axis2:echoResponse" /> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoSOAP11Binding" type="axis2:EchoPortType"> > <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > transport="http://schemas.xmlsoap.org/soap/http" > style="document" /> > <wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echo"> > <soap:operation > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > soapAction="urn:echo" style="document" /> > <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <soap:body > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > use="literal" /> > </wsdl:input> > <wsdl:output > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <soap:body > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > use="literal" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:binding xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoSOAP12Binding" type="axis2:EchoPortType"> > <soap12:binding > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > transport="http://schemas.xmlsoap.org/soap/http" > style="document" /> > <wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echo"> > <soap12:operation > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > soapAction="urn:echo" style="document" /> > <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <soap12:body > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > use="literal" /> > </wsdl:input> > <wsdl:output > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <soap12:body > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > use="literal" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:binding xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoHttpBinding" type="axis2:EchoPortType"> > <http:binding xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > verb="POST" /> > <wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="echo"> > <http:operation > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > location="echo" /> > <wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <mime:content > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" > type="text/xml" /> > </wsdl:input> > <wsdl:output > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <mime:content > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" > type="text/xml" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="Echo"> > <wsdl:port xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoSOAP11port_http" binding="axis2:EchoSOAP11Binding"> > <soap:address > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > > location="http://aleksey.clickajob.dev.voltweb.com:8080/axis2/services/Echo" > > /> > </wsdl:port> > <wsdl:port xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoSOAP12port_http" binding="axis2:EchoSOAP12Binding"> > <soap12:address > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > > location="http://aleksey.clickajob.dev.voltweb.com:8080/axis2/services/Echo" > > /> > </wsdl:port> > <wsdl:port xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > name="EchoHttpport0" binding="axis2:EchoHttpBinding"> > <http:address > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > location="http://localhost/axis2/rest/Echo" /> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > ---------------------------------------------------------------------- > -------------------- > > > Perl client: > ---------------------------------------------------------------------- > -------------------- > > #!/usr/bin/perl -w > > use strict; > use Data::Dumper; > use SOAP::Lite +trace => [qw (transport dispatch result parameters > headers objects method fault freeform trace debug)]; > > my $result = SOAP::Lite > -> service('http://localhost/axis2/services/Echo?wsdl') > -> echo("Hello!"); > > print Data::Dumper::Dumper($result); > ---------------------------------------------------------------------- > -------------------- > > > Error: "Only SOAP 1.1 or SOAP 1.2 messages are supported in the system" > > SOAP request: > ---------------------------------------------------------------------- > -------------------- > > <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope > xmlns:axis2="http://ws.apache.org/axis2" > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > xmlns:ns1="http://org.apache.axis2/xsd" > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns0="http://test.axis2.ws.apache.org/xsd" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"> > <soap:Body> > <axis2:echo> > <string xsi:type="xs:string">Hello!</string> > </axis2:echo> > </soap:Body> > </soap:Envelope> > ---------------------------------------------------------------------- > -------------------- > > > SOAP 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/anonymous > </wsa:Address> > </wsa:ReplyTo> > <wsa:MessageID> > urn:uuid:498FF37873E95AF32411561510436321 > </wsa:MessageID> > <wsa:Action> > http://www.w3.org/2005/08/addressing/fault > </wsa:Action> > </soapenv:Header> > <soapenv:Body> > <soapenv:Fault> > <faultcode></faultcode> > <faultstring> > Only SOAP 1.1 or SOAP 1.2 messages are supported in the > system > </faultstring> > <detail> > <Exception> > org.apache.axis2.AxisFault: Only SOAP 1.1 or SOAP > 1.2 messages are supported in the system; nested > exception is: > org.apache.axiom.soap.SOAPProcessingException: Only > SOAP 1.1 or SOAP 1.2 messages are supported in the > system at > > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequ > est(HTTPTransportUtils.java:286) > > at > > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:145) > at > > javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at > > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > cationFilterChain.java:252) > > at > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi > lterChain.java:173) > > at > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa > lve.java:213) > > at > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa > lve.java:178) > > at > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja > va:126) > > at > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja > va:105) > > at > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv > e.java:107) > > at > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) > at > > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pr > ocessConnection(Http11BaseProtocol.java:663) > > at > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoi > nt.java:527) > > at > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFoll > owerWorkerThread.java:80) > > at > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo > ol.java:684) > > at java.lang.Thread.run(Thread.java:595) Caused by: > org.apache.axiom.soap.SOAPProcessingException: Only > SOAP 1.1 or SOAP 1.2 messages are supported in the > system at > > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode( > StAXSOAPModelBuilder.java:227) > > at > > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElemen > t(StAXSOAPModelBuilder.java:171) > > at > > org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:132) > at > > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelop > e(StAXSOAPModelBuilder.java:155) > > at > > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.identifySOAPVe > rsion(StAXSOAPModelBuilder.java:131) > > at > > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAX > SOAPModelBuilder.java:106) > > at > > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequ > est(HTTPTransportUtils.java:237) > > ... 17 more > </Exception> > </detail> > </soapenv:Fault> > </soapenv:Body> > </soapenv:Envelope> > ---------------------------------------------------------------------- > -------------------- > > > > Any help is greatly appreciated. > > Aleksey > > On 8/18/06, Eran Chinthaka <[EMAIL PROTECTED]> wrote: >> Hi Aleksey, >> >> I think the SOAP namespace is not defined in your request message. >> Can you paste your SOAP request here? >> >> -- Chinthaka >> >> Aleksey Serba wrote: >> > Hi! >> > >> > I've build simple service and deploy it to Apache Axis2 as aar >> > archive ( messageReceiver is RPCMessageReceiver ) >> > >> > I can't make a SOAP call using perl SOAP::Lite. >> > I've turn on debugging on SOAP::Lite and found Axis2 exception >> > org.apache.axiom.soap.SOAPProcessingException: Only SOAP 1.1 or >> > SOAP >> > 1.2 messages are supported in the system. >> > >> > SOAP::Lite 0.68 version >> > Axis2 1.0 release and latest nightly build >> > >> > Is there any way to get it work together or it's totally incompatible? >> > >> > Thanks in advance >> > >> > Aleksey >> > >> > ------------------------------------------------------------------- >> > -- To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> >> >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
