如何在Android中使用Soap连接到Web服务?
我正在使用HttpGet方法从Android应用程序中的web服务检索数据。下面是我现在正在使用的代码如何在Android中使用Soap连接到Web服务?,android,soap,Android,Soap,我正在使用HttpGet方法从Android应用程序中的web服务检索数据。下面是我现在正在使用的代码 String url = URLEditor.encode("http://"+Constants.strURL+"Orders.asmx/CheckWebConnection? TechCode="+username+"&TechPIN="+password); HttpClient httpClient = new DefaultHttpClient();
String url = URLEditor.encode("http://"+Constants.strURL+"Orders.asmx/CheckWebConnection? TechCode="+username+"&TechPIN="+password);
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
if(entity == null) return false;
is = entity.getContent();
但是,HttpGet方法现在没有正确响应,我被要求更改该方法。Web服务不支持HttpPost。如何使用Soap执行相同的操作?我需要下载任何库并附加到Eclipse吗?请帮我下载ksoap2。您将在stackoverflow中找到许多帮助,首先是:
是的,它能工作。。。我在将响应(SoapObject)转换为字符串时得到一块数据。如何解析它?问题是关于连接到Web服务,如果我的答案帮助您将其标记为已接受的答案。如果你想知道如何解析一个soapobject,那么你可以问另一个问题并给出它的详细信息:什么样的web服务,显示数据是什么样的等等。。。