我使用SOAP访问如下所示的代码Web服务,并得到了下面的错误,这是我需要理解帮助:的Android KSOAP错误
的SOAPFault - Fault代码:“SOAP:服务器” faultstring:'System.Web.Services.Protocols.SoapException:服务器无法 处理请求。 ---> System.Data.SqlClient.SqlException:过程或 函数'getWCity'需要提供的参数'@CountryName'不是 。 在WebServicex.GlobalWeather.GetCitiesByCountry(字符串国家或地区名称) ---内部异常堆栈跟踪结束---” faultactor: '空' 的细节:[email protected]
public String Test()
{
String SOAP_ACTION = "http://www.webserviceX.NET/GetCitiesByCountry";
String METHOD_NAME = "GetCitiesByCountry";
String NAMESPACE = "http://www.webserviceX.NET/";
String URL = "http://www.webservicex.com/globalweather.asmx?WSDL";
SOAP_ACTION = NAMESPACE + METHOD_NAME;
String result="invalid";
try
{
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
Request.addProperty("CountryName", "India");
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
HttpTransportSE transport = new HttpTransportSE(URL);
transport.call(SOAP_ACTION, soapEnvelope);
SoapPrimitive resultString;
resultString = (SoapPrimitive) soapEnvelope.getResponse();
result = resultString .toString() ;
return result ;
}
catch (Exception e)
{
e.printStackTrace();
}
return result;
}
句法改进 – clearlight