You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Martin (JIRA)" <ji...@apache.org> on 2010/03/10 23:59:27 UTC

[jira] Created: (WSCOMMONS-526) SOAPEnvelope toString() behavior inconsistant dependent on content

SOAPEnvelope toString() behavior inconsistant dependent on content
------------------------------------------------------------------

                 Key: WSCOMMONS-526
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-526
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
    Affects Versions: Axiom 1.2.8
         Environment: llom, Java 5, Windows
            Reporter: Martin
            Priority: Minor


Using llom 12, SOAPEnvelope.toString() works on empty SOAPEnvelope, SOAPEnvelope's with a SOAPBody, SOAPEnvelope's with a SOAPheader and SoapBofy, but fails on SOAPEnvelope's with only a SOAPHEader with an exception. This behavior is inconsistent. 

Should toString validate the envelope? Should an empty envelope also throw an error? 

IMO, the envelope should be serializable with the header only.

The exception:

Exception in thread "1" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WSCOMMONS-526) SOAPEnvelope toString() behavior inconsistant dependent on content

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

Andreas Veithen reassigned WSCOMMONS-526:
-----------------------------------------

    Assignee: Andreas Veithen

> SOAPEnvelope toString() behavior inconsistant dependent on content
> ------------------------------------------------------------------
>
>                 Key: WSCOMMONS-526
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-526
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>         Environment: llom, Java 5, Windows
>            Reporter: Martin
>            Assignee: Andreas Veithen
>            Priority: Minor
>
> Using llom 12, SOAPEnvelope.toString() works on empty SOAPEnvelope, SOAPEnvelope's with a SOAPBody, SOAPEnvelope's with a SOAPheader and SoapBofy, but fails on SOAPEnvelope's with only a SOAPHEader with an exception. This behavior is inconsistent. 
> Should toString validate the envelope? Should an empty envelope also throw an error? 
> IMO, the envelope should be serializable with the header only.
> The exception:
> Exception in thread "1" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WSCOMMONS-526) SOAPEnvelope toString() behavior inconsistant dependent on content

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

Andreas Veithen commented on WSCOMMONS-526:
-------------------------------------------

Martin,

Can you produce a test case that provides evidence for this issue?

> SOAPEnvelope toString() behavior inconsistant dependent on content
> ------------------------------------------------------------------
>
>                 Key: WSCOMMONS-526
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-526
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>         Environment: llom, Java 5, Windows
>            Reporter: Martin
>            Priority: Minor
>
> Using llom 12, SOAPEnvelope.toString() works on empty SOAPEnvelope, SOAPEnvelope's with a SOAPBody, SOAPEnvelope's with a SOAPheader and SoapBofy, but fails on SOAPEnvelope's with only a SOAPHEader with an exception. This behavior is inconsistent. 
> Should toString validate the envelope? Should an empty envelope also throw an error? 
> IMO, the envelope should be serializable with the header only.
> The exception:
> Exception in thread "1" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WSCOMMONS-526) SOAPEnvelope toString() behavior inconsistant dependent on content

Posted by "Martin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844686#action_12844686 ] 

Martin commented on WSCOMMONS-526:
----------------------------------

Code:
----------------------------------------------------------------------------------------------------------------------
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory;


public class Test {

    /**
     * @param args
     */
    public static void main(final String[] args) {

        final SOAPFactory soapFactory = new SOAP12Factory();
        final SOAPEnvelope soapEnvelopeEmpty = soapFactory.createSOAPEnvelope();
        System.out.println(soapEnvelopeEmpty.toString());

        final SOAPEnvelope soapEnvelopeBody = soapFactory.createSOAPEnvelope();
        soapFactory.createSOAPBody(soapEnvelopeBody);
        System.out.println(soapEnvelopeBody.toString());

        final SOAPEnvelope soapEnvelopeHeader =
            soapFactory.createSOAPEnvelope();
        soapFactory.createSOAPHeader(soapEnvelopeHeader);
        System.out.println(soapEnvelopeHeader.toString());          // <-- Exception

    }
}

----------------------------------------------------------------------------------------------------------------------


Output:

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"></soapenv:Envelope>
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body></soapenv:Body></soapenv:Envelope>
Exception in thread "main" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)
	at Test.main(Test.java:38)


> SOAPEnvelope toString() behavior inconsistant dependent on content
> ------------------------------------------------------------------
>
>                 Key: WSCOMMONS-526
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-526
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>         Environment: llom, Java 5, Windows
>            Reporter: Martin
>            Priority: Minor
>
> Using llom 12, SOAPEnvelope.toString() works on empty SOAPEnvelope, SOAPEnvelope's with a SOAPBody, SOAPEnvelope's with a SOAPheader and SoapBofy, but fails on SOAPEnvelope's with only a SOAPHEader with an exception. This behavior is inconsistent. 
> Should toString validate the envelope? Should an empty envelope also throw an error? 
> IMO, the envelope should be serializable with the header only.
> The exception:
> Exception in thread "1" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WSCOMMONS-526) SOAPEnvelope toString() behavior inconsistant dependent on content

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

Andreas Veithen resolved WSCOMMONS-526.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: Axiom 1.2.9

> SOAPEnvelope toString() behavior inconsistant dependent on content
> ------------------------------------------------------------------
>
>                 Key: WSCOMMONS-526
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-526
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>    Affects Versions: Axiom 1.2.8
>         Environment: llom, Java 5, Windows
>            Reporter: Martin
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: Axiom 1.2.9
>
>
> Using llom 12, SOAPEnvelope.toString() works on empty SOAPEnvelope, SOAPEnvelope's with a SOAPBody, SOAPEnvelope's with a SOAPheader and SoapBofy, but fails on SOAPEnvelope's with only a SOAPHEader with an exception. This behavior is inconsistent. 
> Should toString validate the envelope? Should an empty envelope also throw an error? 
> IMO, the envelope should be serializable with the header only.
> The exception:
> Exception in thread "1" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:177)
> 	at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:224)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.