Discussions

XML & Web services: Axis SOAP Client call thrown NullPointerException.....

  1. Hi,

    I'm having problem with Axis client calls. It was working fine until I re-deployed Axis to the Tomcat 5.0. I guess something going wrong with axis jars files. I forgot what were the jars in %TOMCAT_HOME%/webapps/axis/lib.

    PLEASE help me!!!!


    Here is the part of Axis client call

    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( ENDPOINT );
    call.setOperationName( new QName("shoeboxservice", "submit") );
    call.addParameter( "to", XMLType.XSD_STRING, ParameterMode.IN );
    call.addParameter( "from", XMLType.XSD_STRING, ParameterMode.IN );
    call.addParameter( "sub", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter( "fileName", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter( "file", XMLType.XSD_BASE64, ParameterMode.IN);
    call.setReturnType( XMLType.XSD_STRING );
    Object responseObj = call.invoke( new Object[] { to, from, sub, fileName, file } );
    String respString = (String) responseObj;

    ##########################################
    Here is the error from ant.
    Buildfile: build.xml

    init:
         [echo] buildtime = 2005-04-26T02:26:51

    compile-all:
         [echo] Compiling all Java class files...

    test-case1:
         [echo] SOAP client Test 1...
         [java] april_2005_bankstatement.pdf's size: 30609 bytes
         [java] To:owenFrom :huntington_bankSubject: april_2005_bankstatementFName:
    april_2005_bankstatement.pdf
         [java] AxisFault
         [java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userEx
    ception
         [java] faultSubcode:
         [java] faultString: java.lang.NullPointerException
         [java] faultActor:
         [java] faultNode:
         [java] faultDetail:
         [java] {http://xml.apache.org/axis/}hostname:DELL

         [java] java.lang.NullPointerException
         [java] at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaul
    tBuilder.java:221)
         [java] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFault
    Builder.java:128)
         [java] at org.apache.axis.encoding.DeserializationContext.endElement(De
    serializationContext.java:1087)
         [java] at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java
    :1403)
         [java] at org.apache.xerces.validators.common.XMLValidator.callEndEleme
    nt(XMLValidator.java:1550)
         [java] at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatc
    her.dispatch(XMLDocumentScanner.java:1149)
         [java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLD
    ocumentScanner.java:381)
         [java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:10
    98)
         [java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         [java] at org.apache.axis.encoding.DeserializationContext.parse(Deseria
    lizationContext.java:227)
         [java] at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)

         [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
         [java] at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(Mu
    stUnderstandChecker.java:62)
         [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)

         [java] at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2737)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2413)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2336)
         [java] at org.apache.axis.client.Call.invoke(Call.java:1793)
         [java] at com.shoebox.india.webservices.client.SubmitMessage.submit(Sub
    mitMessage.java:96)
         [java] at com.shoebox.india.webservices.client.SubmitMessage.main(Submi
    tMessage.java:163)
         [java] april_2005_bill.html's size: 24453 bytes
         [java] AxisFault
         [java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userEx
    ception
         [java] faultSubcode:
         [java] faultString: java.lang.NullPointerException
         [java] faultActor:
         [java] faultNode:
         [java] faultDetail:
         [java] {http://xml.apache.org/axis/}hostname:DELL

         [java] java.lang.NullPointerException
         [java] at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaul
    tBuilder.java:221)
         [java] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFault
    Builder.java:128)
         [java] at org.apache.axis.encoding.DeserializationContext.endElement(De
    serializationContext.java:1087)
         [java] at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java
    :1403)
         [java] at org.apache.xerces.validators.common.XMLValidator.callEndEleme
    nt(XMLValidator.java:1550)
         [java] at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatc
    her.dispatch(XMLDocumentScanner.java:1149)
         [java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLD
    ocumentScanner.java:381)
         [java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:10
    98)
         [java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         [java] at org.apache.axis.encoding.DeserializationContext.parse(Deseria
    lizationContext.java:227)
         [java] at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)

         [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
         [java] at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(Mu
    stUnderstandChecker.java:62)
         [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)

         [java] at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2737)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2413)
         [java] at org.apache.axis.client.Call.invoke(Call.java:2336)
         [java] at org.apache.axis.client.Call.invoke(Call.java:1793)
         [java] at com.shoebox.india.webservices.client.SubmitMessage.submit(Sub
    mitMessage.java:96)
         [java] at com.shoebox.india.webservices.client.SubmitMessage.main(Submi
    tMessage.java:163)

    BUILD SUCCESSFUL
    Total time: 5 seconds
  2. Check for null parameters[ Go to top ]

    Check whether any of your parameters is null. I faced the same issue and finally I figured out , one of my input paramter was null.
  3. Hi, I am also facing the same problem.Can you help me out with the solution for this. Thanks Venkat