0

我在从我的网络服务中获得响应时遇到问题。我有这样的事情:

<AuthenticateUser xmlns="http://whatever">
  <request>
    <Username>string</Username>
    <Password>string</Password>
    <Partner>string</Partner>
  </request>
 </AuthenticateUser>

我不知道如何将这些树参数添加到对象<request>

有人可以帮忙吗?

4

1 回答 1

3
private static final String SOAP_ACTION = "http://whatever/AuthenticateUser";
private static final String METHOD_NAME = "AuthenticateUser";
private static final String NAMESPACE = "http://whatever";
private static final String URL = "www.blablabla.com/test?WSDL";

SoapObject authenticateUser = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject request = new SoapObject(NAMESPACE, "request");
request.addProperty("Username","VALUE");
request.addProperty("Password","VALUE");
request.addProperty("Partner","VALUE");
authenticateUser.addSoapObject(request);

我希望这会有所帮助!

于 2011-07-16T19:22:33.143 回答