title: Java NullPointerException when trying to consume a Web Service
body: <p>I have a Java Web Application with a Web Service and a Java Application that tries to consume that Web Service. The Web Service contains an operation named <code>update</code> and i call this operation from the Java Application as:</p>
  
  <pre><code>private static Boolean update(webservice.BsInfo profile)
  {
      webservice.MyWs_Service service = new webservice.MyWs_Service();
      webservice.MyWs port = service.getMyWsPort();
      return port.update(profile);
  } 
  </code></pre>
  
  <p>Here <code>BsInfo</code> is a class defined in the Web Application, and <code>webservice</code> is the package that contains this class in the Web Application. When i am trying to run the Java Application (with the Web App deployed of course) i get the following error:</p>
  
  <pre><code>Exception in thread "Thread-3" javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException
  at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
  at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
  at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
  at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
  at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
  at $Proxy30.update(Unknown Source)
  at Assignment1.BaseStationProfile.update(BaseStationProfile.java:70)
  at Assignment1.BaseStationProfile.run(BaseStationProfile.java:23)
  at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>where line 70 is <code>return port.update(profile);</code>.</p>
  
  <p>What could be possibly wrong here so that the connection to the Web Service doesn't succeed?</p>