Re: SOAP NPE Error

"Scott Nichol" <[email protected]>
Newsgroups gmane.text.xml.soap.user
Message-ID <021201c4a4ba$38cf0460$6401a8c0@northgate>
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" <[email protected]>
To: <[email protected]>
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
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.