在Web服务asmx中调用方法

时间:2013-08-22 08:26:42

标签: android asp.net web-services web

我在asmx web服务中编写了web方法

List<String> GetData(int id) {...} 

然后我在Android应用程序中通过SoapObject调用它 当我使用这段代码时:

response = envelope.getResponse();

我应该定义的响应类型是什么?

1 个答案:

答案 0 :(得分:0)

您可以使用SoapPrimitive获取响应,然后使用toString()将其转换为字符串

SoapPrimitive yourRes = (SoapPrimitive) envelope.getResponse();

String yourStringRes = yourRes.toString();

参考: https://stackoverflow.com/a/18030085/2398886getting java.io.IOException: HTTP request failed, HTTP status: 404 in ksoap2 while passing xml data to soap1.2 android

相关问题