public class Result extends Activity {
private final String NAMESPACE = "http://tempuri.org/";
private final String URL = "http://10.101.21.18/MDSService/Service1.svc?wsdl";
private final String SOAP_ACTION = "http://tempuri.org/IService1/GetAssmtDataByLoginIdAndPassword";
private final String METHOD_NAME = "GetAssmtDataByLoginIdAndPassword";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SoapObject soapObject=new SoapObject(NAMESPACE, METHOD_NAME);
Intent in = getIntent();
soapObject.addProperty("loginName","ginnas");
soapObject.addProperty("password","orcas");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(soapObject);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
System.out.println("call success");
SoapObject soapResponse = (SoapObject)envelope.getResponse();//throws the soap fault exception at this line
Log.i("myApp", soapResponse.toString());
} catch (org.xmlpull.v1.XmlPullParserException ex2) {
System.out.println("EXCEPTION: " + ex2.getMessage());
} catch (SoapFault e) {
System.out.println("SOAPFAULT====");
e.printStackTrace();
} catch (IOException e) {
System.out.println("IOEXCEPTION====");
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
このコードでは、次の例外が発生します。
SoapFault - faultcode: 'a:InternalServiceFault' faultstring: 'Query error occured : Procedure or function 'GetResidentAssmtDataByUser' expects parameter '@loginName', which was not supplied.' faultactor: 'null' detail: org.kxml2.kdom.Node@4053c030
ログイン名とパスワードは正しいです。
これまでに行ったこと:
インターネット許可
envelop.dotNet=true/false
SoapPrimitive 応答 = (SoapPrimitive)envelope.bodyIn;
しかし、これは同じ例外を与えます。私の問題を解決してください。