title: Application close unexpectedly after calling web service if result is null
body: <p>i use the following lines in my program to call web service and taking the result</p>
  
  <p>all thing is fine, but if any time if a web page has no content it has null or white space then application close unexpectedly.</p>
  
  <pre><code>       1) SoapPrimitive result=null;
         2) androidHttpTransport.call(SOAP_ACTION, envelope);
             //upto this line program run smoothly
         3) result = (SoapPrimitive)envelope.getResponse();
  </code></pre>
  
  <p><strong>plz suggest me, how i handle this, because i can only check the result value after completion of 3 line, but error occur before completion of line number 3.</strong></p>
  
  <p><strong>i checked also the envelope value, but it is not null</strong></p>
  
  <p>waiting for reply</p>
  
  <p>This my LogCat after starting This Activity</p>
  
  <pre><code>04-14 07:05:48.209: INFO/ActivityManager(68): Starting: Intent { cmp=infogile.mogilePPR/.VoucherType (has extras) } from pid 434
  **04-14 07:05:48.309: DEBUG/envelope---(434): not null**
  04-14 07:05:48.639: DEBUG/in catch--&gt;(434): java.lang.ClassCastException: org.ksoap2.serialization.SoapObject
  04-14 07:05:48.639: DEBUG/in catch 2--&gt;(434): org.ksoap2.serialization.SoapObject
  04-14 07:05:48.649: DEBUG/AndroidRuntime(434): Shutting down VM
  04-14 07:05:48.649: WARN/dalvikvm(434): threadid=1: thread exiting with uncaught exception (group=0x40015560)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434): FATAL EXCEPTION: main
  04-14 07:05:48.691: ERROR/AndroidRuntime(434): java.lang.RuntimeException: Unable to start activity ComponentInfo{infogile.mogilePPR/infogile.mogilePPR.VoucherType}: java.lang.NullPointerException
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.os.Handler.dispatchMessage(Handler.java:99)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.os.Looper.loop(Looper.java:123)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.main(ActivityThread.java:3647)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at java.lang.reflect.Method.invoke(Method.java:507)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at dalvik.system.NativeStart.main(Native Method)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434): Caused by: java.lang.NullPointerException
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at infogile.mogilePPR.VoucherType.onCreate(VoucherType.java:37)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
  04-14 07:05:48.691: ERROR/AndroidRuntime(434):     ... 11 more
  04-14 07:05:48.719: WARN/ActivityManager(68):   Force finishing activity infogile.mogilePPR/.VoucherType
  04-14 07:05:48.759: WARN/ActivityManager(68):   Force finishing activity infogile.mogilePPR/.ServiceProvider
  04-14 07:05:49.269: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{4060df30 infogile.mogilePPR/.VoucherType}
  04-14 07:05:51.049: INFO/Process(434): Sending signal. PID: 434 SIG: 9
  04-14 07:05:51.079: INFO/ActivityManager(68): Process infogile.mogilePPR (pid 434) has died.
  04-14 07:05:51.099: ERROR/InputDispatcher(68): channel '406eb210 infogile.mogilePPR/infogile.mogilePPR.ServiceProvider (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
  04-14 07:05:51.109: ERROR/InputDispatcher(68): channel '406eb210 infogile.mogilePPR/infogile.mogilePPR.ServiceProvider (server)' ~ Channel is unrecoverably broken and will be disposed!
  04-14 07:05:51.199: INFO/WindowManager(68): WIN DEATH: Window{406e4ff0 infogile.mogilePPR/infogile.mogilePPR.LoginScreen paused=false}
  04-14 07:05:51.339: INFO/WindowManager(68): WIN DEATH: Window{406eb210 infogile.mogilePPR/infogile.mogilePPR.ServiceProvider paused=true}
  04-14 07:05:51.429: ERROR/InputDispatcher(68): Received spurious receive callback for unknown input channel.  fd=165, events=0x8
  04-14 07:05:51.810: WARN/InputManagerService(68): Got RemoteException sending setActive(false) notification to pid 434 uid 10034
  04-14 07:05:52.139: WARN/NotificationService(68): Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@406fef38 in package infogile.mogilePPR
  04-14 07:05:52.139: WARN/ActivityManager(68): setProcessForeground called on unknown pid: 434
  </code></pre>