0
SOAP 2.4를 사용하여 Android를 사용하여 사용자 이름과 암호의 유효성을 검사하려고합니다. 서버에서 응답을 받으면 MySQL 서버에서 내 응용 프로그램에서 요청을 확인 했으므로이를 확인할 수 있습니다. 그러나 아래에서 볼 수 있듯이 addProperty() 메서드를 사용하여 두 개의 매개 변수를 전달합니다. MySQL 서버는 요청을 보지만 값은 null입니다. 결과적으로, "유효하지 않은 사용자 이름 또는 암호"라고 응답을 받지만, 하드 코딩 된 사용자 이름과 암호는 확실히 데이터베이스에 있습니다. 나는 정확하게 parametres를 정확하게 전달하고 있는가? 여기 SOAP validateUser not working
else {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); // set
// up
// request
request.addProperty("User", "raji"); // variable name, value. I got
// the variable name, from
// the wsdl file!
request.addProperty("Password", "PASSWORD");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11); // put all required data into a soap
// envelope
envelope.setOutputSoapObject(request); // prepare request
AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);
httpTransport.debug = true;
httpTransport.call(SOAP_ACTION, envelope); // send request
SoapObject result = (SoapObject) envelope.getResponse(); System.out.println(result);
}
솔루션 코드가 여기에있는 SOAP XML 파일
<s:element name="ValidateUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="User" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>