crafter crafter - 3 months ago 28
Android Question

Ksoap2 complicated reaquest for beginners

How can i create ksoap2 request for this xml.



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://temp.net/">
<soapenv:Header/>
<soapenv:Body>
<tem:GetForexStock>
<tem:request>
<tem:IsIPAD>true</tem:IsIPAD>
<tem:DeviceID>test</tem:DeviceID>
<tem:DeviceType>ipad</tem:DeviceType>
<tem:RequestKey>myKey</tem:RequestKey>
<tem:RequestedSymbol>?</tem:RequestedSymbol>
<tem:Period>Day</tem:Period>
</tem:request>
</tem:GetForexStock>
</soapenv:Body>
</soapenv:Envelope>





I've tried requesting with soap object, but it does not work, i dont know what to do, little help will be appreciated

Answer

All you need is to create a SoapObject and pass it to bodyOut property of envelope.

SoapObject sub = new SoapObject(NAMESPACE, METHOD);
  sub.addProperty("strCode", value);
  envelope.bodyOut = sub;