You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Hubble, Christopher" <CH...@saic.com> on 2004/09/27 19:31:10 UTC

SOAP NPE Error

I'm using a wsdl to set up my web service.  However, whenever I try and run
any methods from the client, I get a NPE returned.  The method on the server
is the default empty stub.  This is the soap message that I'm sending.  

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <nsl:addClientToMCUConnection
soapenv:encodingStyle="http://schemas.xml.soap.org/soap/encoding/"
xmlns:nsl="urn:com.saic.dcts.nci.websvc">
   <spaceID xsi:type="xsd:int">42</spaceID>
   <clientIP xsi:type="xsd:string">10.0.0.1</clientIP>
   <mcuIP xsi:type="xsd:string">10.0.0.2</mcuIP>
  </nsl:addClientToMCUConnection>
 </soapenv:Body>
</soapenv:Envelope>

TIA for any help.

Chris


Re: SOAP NPE Error

Posted by Scott Nichol <sn...@scottnichol.com>.
>From your description, I take it that your service method looks like

void addClientToMCUConnection(int spaceID, String ClientIP, String mcuIP) {}

My guess is that your client is doing something like 

      if (resp.generatedFault()) {
        Fault fault = resp.getFault ();
        ...
      } else {
        Parameter ret = resp.getReturnValue();
        ...
      }

I believe that for a method returning void, the variable ret above will be null.  As such, if you try to "do something" with it, i.e. dereference it, you will get an NPE.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Hubble, Christopher" <CH...@saic.com>
To: <so...@ws.apache.org>
Sent: Monday, September 27, 2004 1:31 PM
Subject: SOAP NPE Error


> I'm using a wsdl to set up my web service.  However, whenever I try and run
> any methods from the client, I get a NPE returned.  The method on the server
> is the default empty stub.  This is the soap message that I'm sending.  
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <soapenv:Body>
>   <nsl:addClientToMCUConnection
> soapenv:encodingStyle="http://schemas.xml.soap.org/soap/encoding/"
> xmlns:nsl="urn:com.saic.dcts.nci.websvc">
>    <spaceID xsi:type="xsd:int">42</spaceID>
>    <clientIP xsi:type="xsd:string">10.0.0.1</clientIP>
>    <mcuIP xsi:type="xsd:string">10.0.0.2</mcuIP>
>   </nsl:addClientToMCUConnection>
>  </soapenv:Body>
> </soapenv:Envelope>
> 
> TIA for any help.
> 
> Chris
> 
>