我见过讨论这个的话题,但似乎没有人发布解决方案。目前,我正在测试将参数传递给我的 .Net Web 服务。当参数到达 Web 服务时,它会添加一个附加字符串,然后我的应用程序也将其返回;但我返回的只是字符串消息,而不是我传递的参数。我的网络服务或我的肥皂方法有问题吗?
肥皂:
SoapObject 请求 = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("A", "workowr");
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
//SoapObject result = (SoapObject)envelope.getResponse();
String resultData = result.toString();
testTV.setText(resultData);
}
catch(Exception e)
{
testTV.setText(e.getMessage());
}
这是我简单的 .Net 网络服务:
公共函数 getRegInfo(ByVal A As String) As String
返回 A + "字符串消息"
结束功能
我将不胜感激任何帮助。