- priority: 5 --> 9
- assigned_to: nobody --> patthoyts
Please help me on the following steps to build the soap request before posting to server.
1. how to specify the encoding style/use "rpc/encoded" and/or "rpc/literal" and/or "document/literal" before initiating the soap request?
2. how to specify the (xsd type ) xsi:type="ns0:ArrayOfKeyValue" to complex type data elements in the soap request?
Following expected soap request and response from server, if I post manually through soapui -
POST /axis2/services/emsprov/ HTTP/1.1
Host: 172.16.32.65:8080
Content-Type: text/xml; charset=utf-8
Content-Length: 829
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: IBM Web Services Explorer
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Connection: close
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="urn:emsprov" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns0:getDevice>
<transactionID soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">1</transactionID>
<deviceUID soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">1</deviceUID>
<options soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns0:ArrayOfKeyValue">
<item xsi:type="ns0:KeyValue">
<key xsi:type="xsd:string">Key1</key>
<value xsi:type="xsd:string">Value1</value>
</item>
</options>
</ns0:getDevice>
</soapenv:Body>
</soapenv:Envelope>
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Wed, 24 Mar 2010 17:12:32 GMT
Connection: close
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:getDeviceResponse xmlns:ns1="urn:emsprov"><transactionID>1</transactionID><status>0</status><description></description><deviceUID>1</deviceUID><developmentUID>1</developmentUID><deviceType>deviceType</deviceType><deviceModel>deviceModel</deviceModel><deviceManufacturer>deviceManufacturer</deviceManufacturer><deviceAttributes><item><key>Key1</key><value>Value1</value></item></deviceAttributes></ns1:getDeviceResponse></soapenv:Body></soapenv:Envelope>