I need to call a SOAP based web service in android. I am using the following code. but it does not call, because it gives the answer in json format. SO how can I do this?
Is there any help?
public void callsoapservice() { final String METHOD_NAME = "GetLoginString"; final String SOAP_ACTION = "http://tempuri.org/GetLoginString"; final String NAMESPACE = " http://tempuri.org/"; final String URL = "http://209.139.209.216/STMobileWS/MobileWebservice/STOlogin.asmx?WSDL"; SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("sCompanyCode", "659"); request.addProperty("sUserName", "Chad12345"); request.addProperty("sPassword", "chad"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER12 ); envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope);
source share