[
https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018754#comment-13018754
]
Ivan commented on AXIS2-5001:
-----------------------------
The link for the message in the mail list.
http://apache-geronimo.328035.n3.nabble.com/SOAPMessage-getSOAPHeaders-return-null-while-no-headers-in-the-soap-envelope-td2805738.html
--->
Codes to reproduce this :
@Test
public void testAxis2SOAPHeaders() throws Exception {
System.setProperty("javax.xml.soap.MessageFactory",
"org.apache.axis2.saaj.MessageFactoryImpl");
String soapXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<S:Envelope
xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><hello
xmlns=\"http://foobar.com\"><param>foobar</param></hello></S:Body></S:Envelope>";
MessageFactory messageFactory = MessageFactory.newInstance();
MimeHeaders headers = new MimeHeaders();
headers.addHeader("Content-Type", "text/xml");
SOAPMessage soapMessage = messageFactory.createMessage(headers, new
ByteArrayInputStream(soapXML.getBytes()));
SOAPHeader header = soapMessage.getSOAPHeader();
if (header == null) {
System.out.println(header);
} else {
System.out.println(header + " " + header.getClass().getName());
}
}
<---
> SOAPMessage.getSOAPHeaders() return null while no headers in the soap envelope
> ------------------------------------------------------------------------------
>
> Key: AXIS2-5001
> URL: https://issues.apache.org/jira/browse/AXIS2-5001
> Project: Axis2
> Issue Type: Bug
> Components: saaj
> Affects Versions: 1.6.0
> Reporter: Ivan
>
> Per Java doc, SOAPMessage.getSOAPHeaders() should throw SOAPException while
> no header exists in the soap message, while it returns null in current
> axis2-saaj implementation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]