Hello M. Amila Chinthaka Suriarachchi , I created the patch. If not OK, the modification is the following, in method (private org.apache.axiom.om.OMElement toOM(final <xsl:value-of select="@type"/> param)):
Replaced: private org.apache.axiom.om.OMElement toOM(final <xsl:value-of select="@type"/> param) throws org.apache.axis2.AxisFault { final javax.xml.stream.XMLStreamReader xmlReader = param.newXMLStreamReader(); while (!xmlReader.isStartElement()) { try { xmlReader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw org.apache.axis2.AxisFault.makeFault(e); } } org.apache.axiom.om.OMDataSource omDataSource = new org.apache.axiom.om.OMDataSource() { public void serialize(java.io.OutputStream outputStream, org.apache.axiom.om.OMOutputFormat omOutputFormat) throws javax.xml.stream.XMLStreamException { try { org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions(); param.save(outputStream,xmlOptions.setSaveNoXmlDecl()); } catch (java.io.IOException e) { throw new javax.xml.stream.XMLStreamException("Problem with saving document",e); } } public void serialize(java.io.Writer writer, org.apache.axiom.om.OMOutputFormat omOutputFormat) throws javax.xml.stream.XMLStreamException { try { org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions(); param.save(writer,xmlOptions.setSaveNoXmlDecl()); } catch (java.io.IOException e) { throw new javax.xml.stream.XMLStreamException("Problem with saving document",e); } } public void serialize(javax.xml.stream.XMLStreamWriter xmlStreamWriter) throws javax.xml.stream.XMLStreamException { org.apache.axiom.om.impl.MTOMXMLStreamWriter mtomxmlStreamWriter = (org.apache.axiom.om.impl.MTOMXMLStreamWriter) xmlStreamWriter; try { org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions(); param.save(mtomxmlStreamWriter.getOutputStream(),xmlOptions.setSaveNoXmlDecl()); mtomxmlStreamWriter.getOutputStream().flush(); } catch (java.io.IOException e) { throw new javax.xml.stream.XMLStreamException("Problem with saving document", e); } } public javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException { return param.newXMLStreamReader(); } }; return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(xmlReader.getName(), org.apache.axiom.om.OMAbstractFactory.getOMFactory(), omDataSource); } By : private org.apache.axiom.om.OMElement toOM(final <xsl:value-of select="@type"/> param) throws org.apache.axis2.AxisFault { org.apache.axiom.om.impl.builder.SAXOMBuilder builder = new org.apache.axiom.om.impl.builder.SAXOMBuilder(); org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions(); xmlOptions.setSaveNoXmlDecl(); xmlOptions.setSaveAggressiveNamespaces(); xmlOptions.setSaveNamespacesFirst(); try { param.save(builder, builder, xmlOptions); org.apache.axiom.om.OMElement element = builder.getRootElement(); return element; } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } } Is it possible for me to become an Axis2 commiter ? Philippe Cordially www.ubik-ingenierie.com On Thu, Dec 11, 2008 at 1:13 PM, Amila Chinthaka Suriarachchi (JIRA) < [EMAIL PROTECTED]> wrote: > > [ > https://issues.apache.org/jira/browse/AXIS2-3760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655619#action_12655619] > > Amila Chinthaka Suriarachchi commented on AXIS2-3760: > ----------------------------------------------------- > > can you please create the patch with the current trunk and using svn diff > command? > > > CLONE -XMLBeans DataBinding generates too many namespaces PERFORMANCE > ISSUE > > > --------------------------------------------------------------------------- > > > > Key: AXIS2-3760 > > URL: https://issues.apache.org/jira/browse/AXIS2-3760 > > Project: Axis 2.0 (Axis2) > > Issue Type: Bug > > Components: databinding > > Affects Versions: 1.4.1, 1.4, 1.3, nightly > > Environment: ALL > > Reporter: Philippe Mouawad > > Assignee: Amila Chinthaka Suriarachchi > > Priority: Critical > > Fix For: 1.5 > > > > Attachments: axiom-api-fix.jar, NamespaceBug.zip, patch.txt > > > > Original Estimate: 24h > > Remaining Estimate: 24h > > > > When using XMLBeans as databinding layer. > > XML Requests and responses are very verbose due to same Namespaces being > declared and redeclared. > > Example: > > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=" > http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><v1:getLocatedProducts > xmlns:v1="http://v1.product.ws.store.kingfisher.com"><v1:param0><xsd:callType > xmlns:xsd="http://data.v1.product.ws.store.kingfisher.com/xsd">1</xsd:callType><xsd:familyCode > xmlns:xsd="http://data.v1.product.ws.store.kingfisher.com/xsd">1</xsd:familyCode><xsd:moduleCode > xmlns:xsd="http://data.v1.product.ws.store.kingfisher.com/xsd">1</xsd:moduleCode><xsd:subFamilyCode > xmlns:xsd="http://data.v1.product.ws.store.kingfisher.com/xsd > ">1</xsd:subFamilyCode></v1:param0></v1:getLocatedProducts></soapenv:Body></soapenv:Envelope> > > You see that http://data.v1.product.ws.store.kingfisher.com/xsd is > declared 4 times instead of one. > > Philippe Mouawad > > www.ubik-ingenierie.com > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > > -- Cordialement. Philippe Mouawad. Ubik-Ingenierie.