Hi,

I am trying to make my client use SOAP 1.2 but it always using the
SOAP 1.1. Below are more details Can someone please let me know the
use/intention of Options.setSoapVersionURI().

For the below client code:

public static void main(String[] args) throws MalformedURLException {

                try {
                        Options options = new Options();
                        EndpointReference endpointReference = new 
EndpointReference(
                                        
"http://localhost:8888/axis2/services/TemperatureConverter";);
                        options.setTo(endpointReference);
                        
options.setSoapVersionURI("http://www.w3.org/2003/05/soap";);
                        options.setAction("urn:c2f");

                        ServiceClient client = new ServiceClient();
                        client.setOptions(options);

                        OMElement request = createRequest();
                        OMElement response = client.sendReceive(request);
                        
                        System.out.println("Request:  " + request);
                        System.out.println("Response: " + response);

                } catch (AxisFault e) {
                        e.printStackTrace();
                }

        }


I get the following SOAP envelope (using tcpmon):
POST /axis2/services/TemperatureConverter HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:anonOutInOp"
User-Agent: Axis2
Host: 127.0.0.1:8888
Transfer-Encoding: chunked

102
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
      <soapenv:Body>
         <ns1:c2f xmlns:ns1="http://temperature.training.wso2.com";>
            <ns1:cTemp>120.0</ns1:cTemp>
         </ns1:c2f>
      </soapenv:Body>
   </soapenv:Envelope>0

I replaced options.setSoapVersionURI("http://www.w3.org/2003/05/soap";) with
options.setSoapVersionURI("http://schemas.xmlsoap.org/wsdl/soap12/";)
but to no avail.

I am aware that by using ServiceClient client = new
ServiceClient(context,....) I can get
a SOAP1.2 envelope. But I am wondering how use SOAP1.2 with
ServiceClient client = new ServiceClient()
and more importantly what is the use/intention of Options.setSoapVersionURI().

Thanks,
Prateek

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to