1
如何findout SOAP_NAMESPACE,SOAP_ACTION,SOAP_METHOD_NAME在WSDL web服務的Android如何解決SOAP錯誤500的Android
我的web低於:
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」
雅我檢查,但這個webservice是不同於我的webservice請檢查我的webservice – Rajneesh 2014-12-19 09:45:15
檢查更新答案成像e – 2014-12-19 09:48:43
謝謝,我會嘗試。 – Rajneesh 2014-12-19 09:49:23