Skip to content Skip to sidebar Skip to footer

Unable To Get Response From Httpresponse When Passing Soap Object (soap1.2) Android?

Code : String response ; try { final String SOAP_ACTION = 'http://tempuri.org/myAction'; final String URL = 'MYURL';

Solution 1:

as its wsHttpBindingWCF service Android

So I Have Solved this using Following :

StringMETHOD_NAME="MyMethodName"; 
StringNAMESPACE="http://tempuri.org/"; 
StringURL="MyUr;";
StringSOAP_ACTION="http://tempuri.org/MySoapAction"; 



SoapObjectrequest=newSoapObject(NAMESPACE, METHOD_NAME);

PropertyInforeq=newPropertyInfo();
req.name = "xmlstring";
req.namespace = NAMESPACE;
req.type = String.class;
req.setValue("........ MY Data.......");// without these `tags <soapenv:`
request.addProperty(req);

Elemente=newElement();
e.setName("To");
e.setNamespace("http://www.w3.org/2005/08/addressing");
e.addChild(Node.TEXT,"MyUrl");

Elemente1=newElement();
e1.setName("Action");
e1.setNamespace("http://www.w3.org/2005/08/addressing");
e1.addChild(Node.TEXT,
        "http://tempuri.org/SoapAction");

SoapSerializationEnvelopeenvelope=newSoapSerializationEnvelope(
        SoapEnvelope.VER12);
envelope.dotNet = true;
envelope.headerOut = newElement[] { e, e1 };
envelope.setOutputSoapObject(request);

HttpTransportSEandroidHttpTransport=newHttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitiveresult= (SoapPrimitive) envelope.getResponse();

StringresultData= result.toString();
Log.i("Result", "" + resultData);

Post a Comment for "Unable To Get Response From Httpresponse When Passing Soap Object (soap1.2) Android?"