我在.NET中有一个web服务我正在使用ksoap2,但我没有得到xml响应。 有什么方法可以调用服务并获得xml响应。?
我的代码是
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("MobileNo", "7777777");
request.addProperty("strstartdate", "2012-01-23");
request.addProperty("strenddate", "2012-01-30");
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
// envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject resultsRequestSOAP = (SoapObject)envelope.getResponse();
Thankx
答案 0 :(得分:0)
androidHttpTransport.call(SOAP_ACTION, envelope);
在此行之后,您可以使用androidHttpTransport.responseDump
以XML格式获取响应。
答案 1 :(得分:0)
添加两个
语句androidHttpTransport.debug = true;
在androidHttpTransport.call(SOAP_ACTION, envelope);
然后添加String theXmlString = androidHttpTransport.responseDump;