SOAP クライアント (WSDL) を使用して Web サービスに接続できる Android アプリケーションを作成しています。ここで、PropertyInfo を使用してリクエストを作成し、それに複数の名前と値を設定できるかどうかを知りたいと思います。私の質問の詳細については、このコードがあります。
String METHOD_NAME = "callLog";
String NAMESPACE = "http://sasd.logpos.com/appservs/app/customize/qwe/ecq.wsdl/";
String URL = "http://sasd.logpos.com/appservs/app/customize/qwe/ecqsoap.php";
String SOAP_ACTION = "http://sasd.logpos.com/appservs/app/customize/qwe/ecq.wsdl/callLog";
Log.i("myEmpId", myEmpId);
Log.i("myPassword", myPassword);
//create request
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//create param
PropertyInfo paramsEmpId = new PropertyInfo();
paramsEmpId.setName("authuserid");
paramsEmpId.setValue(myEmpId);
paramsEmpId.setType(String.class);
paramsPass.setName("authpassword");
paramsPass.setValue(myPassword);
paramsPass.setType(String.class);
request.addProperty(paramsEmpId, "LOGON");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL);
try {
ht.call(SOAP_ACTION, envelope);
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
String response = null;
try {
response = envelope.getResponse().toString();
} catch (SoapFault e) {
e.printStackTrace();
}