我在我的应用程序中使用 KSOAP 来调用一个 web 服务。我遇到了一些异常。我正在使用以下代码:
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet=true;
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
// SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
SoapObject response=(SoapObject)envelope.getResponse(); ------>getting exceptopn here
}
我收到以下错误:
W/System.err(994): SoapFault - faultcode: 'soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
W/System.err(994): --- End of inner exception stack trace ---' faultactor: 'null' detail: org.kxml2.kdom.Node@44ed4ff0
W/System.err(994): at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:116)
W/System.err(994): at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:137)
W/System.err(994): at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
W/System.err(994): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
W/System.err(994): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(994): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
W/System.err(994): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
W/System.err(994): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
W/System.err(994): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
W/System.err(994): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(994): at android.os.Looper.loop(Looper.java:123)
W/System.err(994): at android.app.ActivityThread.main(ActivityThread.java:4363)
W/System.err(994): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(994): at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err(994): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/System.err(994): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/System.err(994): at dalvik.system.NativeStart.main(Native Method)
I/ActivityManager(60): Displayed activity com.redbus/.SearchRoute: 2501 ms (total 2501 ms)
任何人都可以请帮助我..