0

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();
        }
4

2 に答える 2

0

はい、いくつでも追加できますPropertyInfo

URL使用している は常にWSDLURLである必要があるというもう 1 つの問題が見つかりましNamespaceた。同様に確認してください。

//create param
        PropertyInfo paramsEmpId = new PropertyInfo();
        paramsEmpId.setName("authuserid");
        paramsEmpId.setValue(myEmpId);
        paramsEmpId.setType(String.class);

        PropertyInfo paramsPass= new PropertyInfo();// Create a new propertyInfo
        paramsPass.setName("authpassword");
        paramsPass.setValue(myPassword);
        paramsPass.setType(String.class);
        request.addProperty(paramsEmpId);// Changed here
        request.addProperty(paramsPass); // Changed here
于 2013-10-30T08:34:59.070 に答える
0
       yes this possible and  hope this is going to help you

      please check the lines


 paramsPassInfo paramsPass= new paramsPassInfo();

        paramsPass.setName("authpassword");
        paramsPass.setValue(myPassword);
        paramsPass.setType(String.class);

  request.addProperty(paramsPass, "//name");
于 2013-10-30T08:35:48.073 に答える