I found out how to send a request to a webservice using ksoap, but i still cannot figure out where to add my XML to the request ! Here is my code :
public static SoapObject soap () throws IOException, XmlPullParserException {
SoapObject request = new SoapObject (NAMESPACE, METHOD_NAME);
/* HERE IS THE PROBLEM */
request.addProperty(toto, HERE IS MY XML);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (
SoapEnvelope.VER11);
envelope.setOutputSoapObject (request);
HttpTransportSE androidHttpTransport = new HttpTransportSE (URL);
androidHttpTransport.debug = true;
androidHttpTransport.call (SOAP_ACTION, envelope);
SoapObject soapResult = (SoapObject) envelope.getResponse ();
return soapResult;
}
If i delete the "request.addProperty line", it reaches the server, but it does nothing, because i need to send my XML. If someone know how to do that, it would definitely make my day !!
Thanks you for reading this !
No comments:
Post a Comment