gpt4 book ai didi

android - 如何解决android中的SOAP Error 500

转载 作者:行者123 更新时间:2023-11-30 02:28:51 29 4
gpt4 key购买 nike

如何在 Android 的 wsdl Web 服务中找出 SOAP_NAMESPACE、SOAP_ACTION、SOAP_METHOD_NAME

我的网络服务如下:

http://demo.ecount.in/eService.svc?wsdl

请知道的 friend 帮帮我

谢谢。

我的代码如下:

public final static String URL = "http://demo.ecount.in/eService.svc?wsdl";
public static final String NAMESPACE = "http://tempuri.org/";
public static final String SOAP_ACTION_PREFIX = "urn:eService/ExcuteDataSet1";
private static final String METHOD = "ExcuteDataSet1";

private String resp;

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
SoapObject request = new SoapObject(NAMESPACE, METHOD);
//bodyOut is the body object to be sent out with this envelope
envelope.bodyOut = request;
HttpTransportSE transport = new HttpTransportSE(URL);
try {
transport.call(NAMESPACE + SOAP_ACTION_PREFIX + METHOD, envelope);
} catch (IOException e) {
e.printStackTrace();
Log.e("Error", e.toString());
} catch (XmlPullParserException e) {
e.printStackTrace();
Log.e("Error XmlPullParserException", e.toString());
}
//bodyIn is the body object received with this envelope
if (envelope.bodyIn != null) {
//getProperty() Returns a specific property at a certain index.
SoapPrimitive resultSOAP = (SoapPrimitive) ((SoapObject) envelope.bodyIn)
.getProperty(0);
resp=resultSOAP.toString();
}

它给出错误:“HTTP 请求失败,HTTP 状态:500”

最佳答案

请检查下面的快照以了解 SOAP_NAMESPACE、SOAP_ACTION、SOAP_METHOD_NAME

enter image description here

关于android - 如何解决android中的SOAP Error 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27563023/

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