SOAPFault에 - faultCode를 '비누 : 서버' 을 faultstring : 'System.Web.Services.Protocols.SoapException : 서버가 프로세스 요청을 할 수 없습니다. ---> System.Data.SqlClient.SqlException : Procedure 또는 함수 'getWCity'에 '@CountryName'매개 변수가 필요하며 이는 이 아닙니다. WebServicex.GlobalWeather.GetCitiesByCountry (문자열 COUNTRYNAME) 에서 --- 내부 예외 스택 추적의 끝 --- 'faultactor :'널 (null) '세부 : [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