gpt4 book ai didi

java - Android ksoap2 将对象添加到对象中

转载 作者:行者123 更新时间:2023-12-02 00:46:29 25 4
gpt4 key购买 nike

我在从网络服务获取响应时遇到问题。我有这样的东西:

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

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

有人可以帮忙吗?

最佳答案

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);

希望对您有所帮助!

关于java - Android ksoap2 将对象添加到对象中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4886177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com