gpt4 book ai didi

android - 服务器无法处理您的请求,值不能为空 :soap parsing

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:37:36 25 4
gpt4 key购买 nike

在请求 soap 请求时抛出以下错误。

 10-02 06:05:05.840: E/@@@@@@@@@@(1722): RawXML Request:<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. ---&gt; Value cannot be null.
10-02 06:05:05.840: E/@@@@@@@@@@(1722): Parameter name: String</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

我真诚地传递了必需的参数,即使它抛出错误。

这是我用于 soap 请求的函数。

更改密码

    public  void ChangePassword(String METHOD, String token,
String userId, String oldPassword,String newPassword) {
SoapObject request = null;

request = new SoapObject(NAME_SPACE, METHOD);

Log.e("####", "ChangePassword token=" + token.trim());
Log.e("####", "ChangePassword userId=" + userId);
Log.e("####", "ChangePassword oldPassword=" + oldPassword);
Log.e("####", "ChangePassword newPassword=" + newPassword);

request.addProperty("token", token.trim());
request.addProperty("userId", userId);
request.addProperty("oldPassword", oldPassword);
request.addProperty("newPassword", newPassword);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);

try {
HttpTransportSE transport = new HttpTransportSE(URL);
transport.debug = true;

String action=SOAP_ACTION+METHOD;
Log.e("@@@@", "soap action="+action);

transport.call(action, envelope);
// transport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

String response = transport.responseDump;
Log.e("@@@@@@@@@@","RawXML Request:"+response.toString());


} catch (Exception e) {
e.printStackTrace();
}

}

我在点击请求时是否遗漏了什么?

最佳答案

我怀疑您的网络服务存在问题。确保您所有的参数名称都与您在 Android 应用中使用的值匹配。

关于android - 服务器无法处理您的请求,值不能为空 :soap parsing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26155355/

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