[ 
https://issues.apache.org/jira/browse/WSCOMMONS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lucas Theisen reopened WSCOMMONS-160:
-------------------------------------


After more testing and debugging I found that there is more of the same.  It 
turns out that if you toString( ) the XMLStreamReader object, it goes through 
the serialize method of OMSerializerUtil.  During this processing it will cache 
the results of serialization including the namespace prefix's that we fixed in 
the previous patch.  This way, when my request went through, after calling 
toString, the request would succeed.  However, if toString was not called it 
would fail.  It turns out that a different serializer is used during the SOAP 
serialization for send.  This serialization happens in StreamingOMSerializer.  
The code in this class appears to be a cut/paste from OMSerailizerUtil (except 
the loop construct changes from while to for).  So applying the same fixes we 
applied to OMSerializerUtil fixed StreamingOMSerailizer as well.  I will attach 
the patch for this class.  Please apply it to the official source tree.

> StAXOMBuilder is stripping off namspace prefix's from attributes that need 
> namespace qualification
> --------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-160
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-160
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Using Axis2-1.1.1 on Fedora Core 4.
>            Reporter: Lucas Theisen
>         Assigned To: Davanum Srinivas
>            Priority: Critical
>         Attachments: axiom_StAXOMBuilder_patch2.txt, 
> omserializerutil_patch.txt, TestStAXOMBuilder.java
>
>
> Here is a code sample:
> public class TestStAXOMBuilder {
>     /**
>      * @param args
>      */
>     public static void main( String[] args ) throws Exception {
>         String xmlString = "<root xmlns='http://custom.com'><node 
> cust:id='123' xmlns:cust='http://custom.com' /></root>";
>         org.apache.xmlbeans.XmlObject param = 
> org.apache.xmlbeans.XmlObject.Factory.parse( xmlString );
>         
>         // print out the object before it gets processed
>         System.out.println( "before - '" + param.toString( ) + "'" );
>         
>         // copied code from the generated stub class toOM method
>         org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new 
> org.apache.axiom.om.impl.builder.StAXOMBuilder(
>                 org.apache.axiom.om.OMAbstractFactory.getOMFactory( ),
>                 new org.apache.axis2.util.StreamWrapper( param
>                         .newXMLStreamReader( ) ) );
>         org.apache.axiom.om.OMElement documentElement = builder
>                 .getDocumentElement( );
>         ((org.apache.axiom.om.impl.OMNodeEx) documentElement).setParent( null 
> );
>         // end copied code
>         // now print the object after it has been processed
>         System.out.println( "after - '" + documentElement.toString( ) + "'" );
>     }
> }
> The output I get from running this is:
> before - '<root xmlns="http://custom.com";>
>   <node cust:id="123" xmlns:cust="http://custom.com"/>
> </root>'
> after - '<root xmlns="http://custom.com";><node xmlns:cust="http://custom.com"; 
> id="123" /></root>'
> Notice that the namespace prefix "cust:" is removed from the "id" attribute 
> therby making this an invalid xml.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to