org.apache.axis2.saaj.SOAPConnectionImpl(line # 181) Null checking is required
------------------------------------------------------------------------------
Key: AXIS2-3149
URL: https://issues.apache.org/jira/browse/AXIS2-3149
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: client-api
Affects Versions: 1.1.1
Reporter: Jayanta Sarkar
Priority: Blocker
I have written a client program as below to send a soap message. When I
response envelope reaches if it does not contain any soap header it throws a
null pointer exception. I found that there is no null checking at the line #
181 of the org.apache.axis2.saaj.SOAPConnectionImpl class and
respOMSoapEnv.getHeader() returns null value.
Below is the client code to send the request envelope.
..............................................
String xmlInput = "<xml payload>";
Document docBody = loadDocument(new StringReader(xmlInput));
MessageFactory factory = new MessageFactoryImpl();
SOAPMessage soapMsg = factory.createMessage();
SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = conFactory.createConnection();
// Point to the service we want to call, and then call it. Store the
response
// in the "reply" object.
URL endPoint = new
URL("http://localhost:8080/WebServiceTrn/services/CTSTrainingService");
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
sb.addDocument(docBody);
SOAPMessage reply = con.call(soapMsg,endPoint);
reply.writeTo(System.out);
..............................................
As the Axis2 implementation is the urgent requirement of our project, please
advise accordingly as soon as possible.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]