需要帮助!我正试图解决这个问题
03-01 20:56:17.342: WARN/System.err(610): java.lang.NullPointerException
03-01 20:56:17.463: WARN/System.err(610): at java.io.Writer.write(Writer.java:152)
03-01 20:56:17.482: WARN/System.err(610): at org.kxml2.io.KXmlSerializer.startTag(KXmlSerializer.java:422)
03-01 20:56:17.482: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:613)
03-01 20:56:17.522: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:657)
03-01 20:56:17.532: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeProperty(SoapSerializationEnvelope.java:645)
03-01 20:56:17.542: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:614)
03-01 20:56:17.562: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:598)
03-01 20:56:17.572: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:655)
03-01 20:56:17.592: WARN/System.err(610): at org.ksoap2.serialization.SoapSerializationEnvelope.writeBody(SoapSerializationEnvelope.java:579)
03-01 20:56:17.592: WARN/System.err(610): at org.ksoap2.SoapEnvelope.write(SoapEnvelope.java:192)
03-01 20:56:17.612: WARN/System.err(610): at org.ksoap2.transport.Transport.createRequestData(Transport.java:74)
03-01 20:56:17.622: WARN/System.err(610): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:58)
03-01 20:56:17.642: WARN/System.err(610): at com.siteStory.webService.UtilityWS.sendRequest(UtilityWS.java:48)
03-01 20:56:17.642: WARN/System.err(610): at com.siteStory.webService.UserWS.insertUser(UserWS.java:90)
03-01 20:56:17.662: WARN/System.err(610): at com.siteStory.login.Registration$1.onClick(Registration.java:37)
03-01 20:56:17.662: WARN/System.err(610): at android.view.View.performClick(View.java:2408)
03-01 20:56:17.692: WARN/System.err(610): at android.view.View$PerformClick.run(View.java:8816)
03-01 20:56:17.702: WARN/System.err(610): at android.os.Handler.handleCallback(Handler.java:587)
03-01 20:56:17.712: WARN/System.err(610): at android.os.Handler.dispatchMessage(Handler.java:92)
03-01 20:56:17.722: WARN/System.err(610): at android.os.Looper.loop(Looper.java:123)
03-01 20:56:17.732: WARN/System.err(610): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-01 20:56:17.782: WARN/System.err(610): at java.lang.reflect.Method.invokeNative(Native Method)
03-01 20:56:17.782: WARN/System.err(610): at java.lang.reflect.Method.invoke(Method.java:521)
03-01 20:56:17.812: WARN/System.err(610): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-01 20:56:17.822: WARN/System.err(610): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-01 20:56:17.832: WARN/System.err(610): at dalvik.system.NativeStart.main(Native Method)
我依赖本教程:http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html
我想我不添加一些属性,但我添加的是:
PropertyInfo p1 = new PropertyInfo();
p1.setName("user");
p1.setValue(user);
p1.setType(User.class);
utilityWS.setProperty(p1);
答案 0 :(得分:-2)
只是提出一个断点,看看为什么它会抛出一个NPE ..