You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Hudson (Commented) (JIRA)" <ji...@apache.org> on 2011/10/21 01:44:10 UTC

[jira] [Commented] (AXIOM-114) Soap envelope rpc-encoded namespace issue

    [ https://issues.apache.org/jira/browse/AXIOM-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132214#comment-13132214 ] 

Hudson commented on AXIOM-114:
------------------------------

Integrated in ws-axiom-trunk #630 (See [https://builds.apache.org/job/ws-axiom-trunk/630/])
    AXIOM-114: Added a method to OMElement that allows to get an XMLStreamReader that strictly preserves the namespace context (by generating additional namespace declarations on the root START_ELEMENT event).

veithen : 
Files : 
* /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetXMLStreamReaderWithPreserveNamespaceContext.java
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/element
* /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/resources/org/apache/axiom/ts/om/element/AXIOM-114.xml

                
> Soap envelope rpc-encoded namespace issue 
> ------------------------------------------
>
>                 Key: AXIOM-114
>                 URL: https://issues.apache.org/jira/browse/AXIOM-114
>             Project: Axiom
>          Issue Type: Bug
>    Affects Versions: 1.2.8
>         Environment: java 1.6
>            Reporter: Luca Cavanna
>             Fix For: 1.2.13
>
>         Attachments: AxiomSoapRpcEncoded.java, AxiomSoapRpcEncodedOMSource.java, soaprequest.xml
>
>
> I have replaced saaj with axiom in my projects to manage soap handling.
> I have an rpc-encoded soap envelope containing the declarations of soapenv (xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/") and xsi (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") namespaces. 
> The first element of the soap body references soapenv in one of his attributes (soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"). Some xml elements in the soap body reference the xsi namespace (xsi:type="soapenc:string") as well.
> When I try to parse the soap body (extracted from the soap envelope) using JDOM or DOM4J I get a SaxParseException because the soapenv and xsi namespaces are not bound:
> org.xml.sax.SAXParseException: The prefix "soapenv" for attribute "soapenv:encodingStyle" associated with an element type "ns1:sendMessage" is not bound.
> Saaj handles correctly the soapenv and and xsi declarations moving them in the soap body; with axiom the soap body contain only the reference to those namespaces and not the declarations.
> The issue seems to be creating a StAXSource from Axiom payload element (obtained by calling axiomSoapMessage.getSOAPEnvelope().getBody().getFirstElement()); serializing payload calling serialize method namespace are correctly handled, but
> creating a StAXSource using XMLStreamReader and transforming it to a StreamResult I get an xml not parseable because namespaces are not bound.
> I have found a workaround transforming the StAXSource in a JDOMResult.
> The problem rises when you create a StAXSource from an Axiom payload element (calling axiomSoapMessage.getSOAPEnvelope().getBody().getFirstElement()). When you call the serialize method, namespaces are correctly handled; but if you create a StAXSource using an XMLStreamReader and try to transform it to a StreamResult you get the SaxParseException mentioned above.
> I have found a workaround transforming the StAXSource in a JDOMResult.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org