0

我在 .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();

谢谢

4

2 回答 2

0

添加两个语句,即

androidHttpTransport.debug = true;

就在之前androidHttpTransport.call(SOAP_ACTION, envelope);

就在它添加之后 String theXmlString = androidHttpTransport.responseDump;

于 2014-01-21T12:43:04.350 回答
0
androidHttpTransport.call(SOAP_ACTION, envelope);

在此行之后,您可以使用androidHttpTransport.responseDump以获取 XML 格式的响应。

于 2012-02-07T14:45:08.973 回答