Send Multiple values as a parameter using SOAP in android? -
can body please guide me on this.i totally new using ksoap in android.following details in xml.and want send details in webservice.please tell me how addproperty doing wrong there?
<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <checkloginwithiphonedata xmlns="http://tempuri.org/"> <username>string</username> <pin>string</pin> <password>string</password> <deviceid>string</deviceid> </checkloginwithiphonedata> </soap:body> </soap:envelope> and in java code have done this:
public void showdetails() { soapobject request = new soapobject(namespace, method_name1); request.addproperty("username","sometext"); request.addproperty("pin","sometext"); request.addproperty("password","sometext"); request.addproperty("deviceid","sometext"); soapserializationenvelope envelope = new soapserializationenvelope( soapenvelope.ver11); envelope.setoutputsoapobject(request); envelope.dotnet = true; seek { httptransportse androidhttptransport = new httptransportse(url); androidhttptransport.debug=true; androidhttptransport.call(soap_action1, envelope); log.e("response",""+androidhttptransport.responsedump); soapobject result = (soapobject) envelope.bodyin; log.e("result",""+result); if (result != null) { log.e("val", "" + result.getproperty(0).tostring()); } else { toast.maketext(getapplicationcontext(), "no response",toast.length_long).show(); } } grab (exception e) { e.printstacktrace(); } } i have called method in background.
however next error when seek print response log.e("response",""+androidhttptransport.responsedump);
<?xml version="1.0" encoding="utf-8"?><soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"><soap:body><soap:fault><faultcode>soap:client</faultcode><faultstring> system.web.services.protocols.soapexception: server did not recognize value of http header soapaction: https://tempuri.org/checkloginwithiphonedata.
request = new soapobject(util.getinstance().namespace, method); authenticaterequest authenticaterequest = (authenticaterequest) params[0]; soapobject authenticate = new soapobject(util.getinstance().namespace, "checkloginwithiphonedata"); authenticate.addproperty("username", <value>); authenticate.addproperty("pin", <value>); authenticate.addproperty("password", <value>); authenticate.addproperty("deviceid", <value>); propertyinfo propertyinfo1 = new propertyinfo(); propertyinfo1.namespace = util.getinstance().namespace; propertyinfo1.name = "checkloginwithiphonedata"; request.addproperty(propertyinfo1, authenticate);
hope help!
android
No comments:
Post a Comment