web services - Ksoap2 Trouble consuming Webservices on Android -
i created webservices in .net there trouble when consuming android app. noticed webservice not getting parameters send android. however, consumed .net app , works ok.
note: webservice (webservicex/globalweather .asmx) android app works perfectly.
i put spaces in string url variable because can't publish more 2 links
public class cargadatosws { private static final string soap_action = "http://www.esmerlinp.somee.com/getaccess"; private static final string method_name = "getaccess"; private static final string namespace = "http://www.esmerlinp.somee.com"; private static final string url = "http ://www. esmerlinp.somee .com/registro.asmx"; public string getacess(string email,string pwd){ string res=null; soapobject rpc; rpc = new soapobject(namespace, method_name); rpc.addproperty("email", email); rpc.addproperty("password", pwd); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.bodyout = rpc; envelope.dotnet = true; envelope.encodingstyle = soapserializationenvelope.xsd; httptransportse androidhttptransport= null; try { androidhttptransport = new httptransportse(url); androidhttptransport.debug = true; androidhttptransport.call(soap_action, envelope); res = envelope.getresponse().tostring(); }catch (exception e){ system.out.println(e.getmessage()); res=e.getmessage(); } return res; } }
Comments
Post a Comment