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:39:05 UTC

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

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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030587#comment-13030587 ] 

Ivan commented on AXIS2-5001:
-----------------------------

I also checked all SAAJ, JAX-WS and even SOAP spec in the past, and did not find any word about requiring an empty header in the SOAP message
One of the case is that, it uses a handler to check whether non-addressing related elements in the response message if addressing feature is disabled. In the validation codes, I saw there is a try-catch block for the SOAPException, seems that TCK case allow that exception while getSOAPHeader() is called. Generally speaking, to make those cases pass, one way is to make the Axis2 SAAJ complies with the SAAJ spec and throw SOAPException if no header exists in the message. Or, always added an empty header for the SOAP message,and leave the current behavior there, which means to return null if no header exists in the message (That is what RI does now, I think). Personally, the first way is better, based on the condition, which no empty header is required for the SOAP message.
If any further information is required, please comment it freely. Thanks.


> 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.5.4
>            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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030587#comment-13030587 ] 

Ivan edited comment on AXIS2-5001 at 5/9/11 2:48 AM:
-----------------------------------------------------

I also checked all SAAJ, JAX-WS and even SOAP spec in the past, and did not find any word about requiring an empty header in the SOAP message
One of the case is that, it uses a handler to check whether no addressing related elements in the response message if addressing feature is disabled. In the validation codes, I saw there is a try-catch block for the SOAPException, seems that TCK case allow that exception while getSOAPHeader() is called. Generally speaking, to make those cases pass, one way is to make the Axis2 SAAJ complies with the SAAJ spec and throw SOAPException if no header exists in the message. Or, always added an empty header for the SOAP message,and leave the current behavior there, which is to return null if no header exists in the message (That is what RI does now, I think). Personally, the first way is bette on the condition of no empty header required for the SOAP message in any spec.
If any further information is required, please comment it freely. Thanks.


      was (Author: xuhaihong):
    I also checked all SAAJ, JAX-WS and even SOAP spec in the past, and did not find any word about requiring an empty header in the SOAP message
One of the case is that, it uses a handler to check whether non-addressing related elements in the response message if addressing feature is disabled. In the validation codes, I saw there is a try-catch block for the SOAPException, seems that TCK case allow that exception while getSOAPHeader() is called. Generally speaking, to make those cases pass, one way is to make the Axis2 SAAJ complies with the SAAJ spec and throw SOAPException if no header exists in the message. Or, always added an empty header for the SOAP message,and leave the current behavior there, which means to return null if no header exists in the message (That is what RI does now, I think). Personally, the first way is better, based on the condition, which no empty header is required for the SOAP message.
If any further information is required, please comment it freely. Thanks.

  
> 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.5.4
>            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


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

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-5001:
-----------------------------------

    Affects Version/s:     (was: 1.6.0)
                       1.5.4

> 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.5.4
>            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


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

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-5001:
-----------------------------------

    Labels: Geronimo  (was: )

> 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.5.4
>            Reporter: Ivan
>              Labels: Geronimo
>         Attachments: AXIS2-5001.patch
>
>
> 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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019155#comment-13019155 ] 

Ivan commented on AXIS2-5001:
-----------------------------

Yes, I already mentioned it in the email posted in the user list, and I also agree that it might not need to fix even violate with the spec. But from TCK side, I saw the same case passed for RI JAX-WS implementation, and the reason for it is that they always includes an empty header for the soap message. That is why I hope to find another workaround solution for it (Add an empty header too ?), or might be I could try to challenge those cases, which is a bit difficult :-( 

> 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.5.4
>            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


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

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030398#comment-13030398 ] 

Andreas Veithen commented on AXIS2-5001:
----------------------------------------

If you provide a test case that reproduces the issue, we may be able to help you to figure out what the root cause is. Right now we don't have enough information about the issue.

> 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.5.4
>            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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ 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


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

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018996#comment-13018996 ] 

Andreas Veithen commented on AXIS2-5001:
----------------------------------------

The reference implementation has the same behavior. See also SAAJ-15 [1]. Are you sure that the failure in the JAX-WS TCK test is caused by the behavior SOAPMessage#getSOAPHeaders()? Did you test with a modified version of that method?

[1] http://java.net/jira/browse/SAAJ-15

> 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.5.4
>            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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan updated AXIS2-5001:
------------------------

    Attachment: AXIS2-5001.patch

The patch uses a system property to control the behavior. by default, it keeps on the current behavior, which returns null while no header exists in the soap message. 

> 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.5.4
>            Reporter: Ivan
>         Attachments: AXIS2-5001.patch
>
>
> 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


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

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030517#comment-13030517 ] 

Andreas Veithen commented on AXIS2-5001:
----------------------------------------

That sounds like a workaround that doesn't eliminate the root cause. Very likely, the presence of the empty header is required by some other part of the SAAJ or JAX-WS spec to which Axis2 doesn't comply. If this is the case, then we need to figure out which requirement is violated and fix it.

Again, unless we get a test case that reproduces the actual issue (or at least a description of what the TCK test attempts to do) we will not be able to investigate this.

> 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.5.4
>            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


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

Posted by "Ivan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030487#comment-13030487 ] 

Ivan commented on AXIS2-5001:
-----------------------------

Hi, Andreas, thanks for following this issue. From my investigation, if I updated axiom codes a bit to force an empty header is added, the cases would pass. Also, I tried some of the cases (did not have time to try all the failed cases caused by NPE), if an exception is thrown, the cases would pass too. So I am thinking, is it possible to add a control flag (said saaj.strict) for this, the users could switch the behaviors between throwing an exception or returning null ? 

> 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.5.4
>            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