Hi

 

I am a newbie to soap and web services and I am getting an exception that I cannot find the cause to. Is there anyone that can help?

I have tried to build the simplest client and service possible. When the client invokes a service, the xml that it gets back is a null pointer exception. I just cannot find the cause of the problem. Here is the exception:

 

<?xml version='1.0' encoding='UTF-8'?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

<SOAP-ENV:Fault>

<faultcode>SOAP-ENV:Server.Exception:</faultcode>

<faultstring>java.lang.NullPointerException</faultstring>

<faultactor>/soap/servlet/messagerouter</faultactor>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Here is the deployment descriptor for the web service

 

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="ani" type="message">

  <isd:provider type="java" scope="Application" methods="responsaQuery">

    <isd:java class="altituderesponsatest.Processor" static="false"/>

  </isd:provider>

 

  <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>

</isd:service>

 

Here is the web service:

package altituderesponsatest;

//import statements

 

public class Processor {

 

  public void responsaQuery(Envelope env, SOAPContext req, SOAPContext res)

        throws IOException, MessagingException {

      Document doc = new org.apache.xerces.dom.DocumentImpl();

      Element response = doc.createElement("response");

      Vector bodyEntries = new Vector();

      bodyEntries.add(response);

      StringWriter writer = new StringWriter();

      env.marshall(writer, null);

      res.setRootPart(writer.toString(), "text/xml");

    }

}

 

Any help would be very much appreciated

 

Tony

 

 

Reply via email to