You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Ivan (JIRA)" <ji...@apache.org> on 2011/04/12 09:43:06 UTC

[jira] [Commented] (AXIS2-5001) SOAPMessage.getSOAPHeaders() return null while no headers in the soap envelope

    [ 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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org