0

アプリケーションで SOAP サービスを使用しています。エラー メッセージが表示されます。

 SoapFault - faultcode: 'soap:Client' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 301). ---> System.InvalidOperationException: The specified type was not recognized: name='authentication',

私のSOAPリクエスト構造は次のとおりです。

 <authentication>
    <LoginID>string</LoginID>
    <Password>string</Password>
  </authentication>
  <Id>int</Id>
  <Str>string</Str>   

私のコードは次のとおりです。

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

                PropertyInfo usrid =new PropertyInfo();
            usrid.setName("LoginID");
            usrid.setValue(userid);
            usrid.setType(String.class);
            request.addProperty(usrid);        

//          
            PropertyInfo pass =new PropertyInfo();
            pass.setName("Password");
            pass.setValue(password);
            pass.setType(String.class);
            request.addProperty(pass);

                PropertyInfo rote =new PropertyInfo();
            rote.setName("Id");
            rote.setValue(4114616);
            rote.setType(int.class);
            request.addProperty(rote);
//          
            PropertyInfo dte =new PropertyInfo();
            dte.setName("Str");
            dte.setValue(date);
            dte.setType(String.class);
            request.addProperty(dte);



 androidHttpTransport.call(SOAP_ACTION,envelope);              
//              SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
                System.out.println("subbu");
                Object response=(Object)envelope.getResponse();---->I think i am getting error here.

誰でも私が間違ったことを助けてください。

4

1 に答える 1

1

次のリンクを確認してください。

authenticationは複雑なオブジェクトですが、すべてのプロパティを連続して追加しました。次のようなことを試してください:

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

SoapObject authenticate = new SoapObject(NAMESPACE, "authenticate");
authenticate.addProperty("LoginID", "login");
authenticate.addProperty("Password", "password");

request.addSoapObject(authenticate);
request.addProperty("Id", "123");
request.addProperty("Str", "string");
于 2012-05-16T04:40:44.543 に答える