如何在wsdl web服务中找到SOAP_NAMESPACE,SOAP_ACTION,SOAP_METHOD_NAME for android
我的网络服务如下:
http://demo.ecount.in/eService.svc?wsdl
如果有人知道,请帮助我。
谢谢。
我的代码在下面:
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”
答案 0 :(得分:1)
请查看以下快照,了解SOAP_NAMESPACE,SOAP_ACTION,SOAP_METHOD_NAME