2016-12-29 5 views
1
내가 이해하는 데 도움이 필요 다음과 같은 오류, 아래의 코드에서 웹 서비스에 액세스하고 얻을 비누를 사용하고

:안드로이드 KSoap 오류

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; 
} 
+0

문법 개선 – clearlight

답변

2

SoapObject (NAMESPACE, METHOD_NAME); 그것은 네임 스페이스로 사용 그것이 있어야

"http://www.webserviceX.NET/"

하지만

"http://www.webserviceX.NET"

당신은 변경할 수 :

String METHOD_NAME = "GetCitiesByCountry"; 
String NAMESPACE = "http://www.webserviceX.NET"; 


SOAP_ACTION = NAMESPACE + "/" + METHOD_NAME; 
,536,
+1

이 문제를 해결해 주셔서 감사합니다. –