ksoap2 error sending complex object
Need help! I'm trying to figure this problem
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.ksoap开发者_StackOverflow社区2.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)
I relied on this tutorial: http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html
I think I don't add some property but what I added is:
PropertyInfo p1 = new PropertyInfo();
p1.setName("user");
p1.setValue(user);
p1.setType(User.class);
utilityWS.setProperty(p1);
Just put a break point and see why it throws an NPE..
精彩评论