錯誤訊息如下:
: W/System.err(10053): java.io.IOException: HTTP request failed, HTTP status: 500
: W/System.err(10053): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:195)
: W/System.err(10053): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
: W/System.err(10053): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:111)
: W/System.err(10053): at net.xxx.ooo.activity.abc.loadWebService(HospitalVisitMain.java:147)
: W/System.err(10053): at net.xxx.ooo.activity.abc.access$4(HospitalVisitMain.java:130)
: W/System.err(10053): at net.xxx.ooo.activity.abc$2.run(HospitalVisitMain.java:98)
: I/info(10053): HTTP request failed, HTTP status: 500
後來發現的原因是,沒有輸入參數送到webservice,= =
網路有查到也有人遇到是ksoap的jar檔有問題,
若有遇到的人也可以嘗試更換ksoap的jar檔~
傳參數到webservice
只要加入
而上面我多加了10000 是指定若網頁讀取超過10秒鐘
SoapObject request = new SoapObject(SysServerParam.getInstance()
.getNameSpace(), SysServerParam.getInstance().getWebSiteMeth());
request.addProperty("username", SysServerParam.getInstance().getUserName() );
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTtansport = new HttpTransportSE(
SysServerParam.getInstance().getServerURL(), 10000);
androidHttpTtansport.debug = true;
則跳到catch事件~
沒有留言:
張貼留言