Wednesday, February 18, 2009

Axis2 - How to set the SOAP Version on a client

There may be instances where you want your Axis2 client to send request in a specific SOAP Version. Axis2 supports both SOAP 1.1 as well as SOAP 1.2. The default used is SOAP 1.2.

Setting the SOAP version can be done as follows, for SOAP 1.1

for SOAP 1.2


Brandon said...

Very useful! Wish the javadoc explained how to do this more clearly. There are numerous constants available, but no clear explanation on how to use them in the axis2 documentation.

Unknown said...
This comment has been removed by the author.
Unknown said...

Great! I follow all of your Axis2 posts.

I'm having a trouble connecting to a webservice (SugarCRM, Axis2) because of the RPC encoding mentioned in their WSDL.

The exeption I get is -

org.apache.axis2.databinding.ADBException: Unsupported type Array

I came to know that, Axis2 does not support this kind of encoded transfer.

Could you please tell me whether there is any solution like changing WSDL, or setting any tricky option just like your post.

Anonymous said...

I am facing problem in proxying the Bugzilla webservice in wso2esb....

ERROR - ServerWorker Error processing POST request
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found methodCall
at org.apache.axis2.AxisFault.makeFault(
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(
at org.apache.axis2.transport.base.threads.NativeWorkerPool$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found methodCall
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(
at org.apache.axis2.builder.SOAPBuilder.processDocument(
at org.apache.axis2.transport.TransportUtils.createDocumentElement(
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
... 6 more