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

Thomas Raddatz commented on AXIS2-5449:
---------------------------------------

Please also notice that old bug report of Woodstox, which describes a similar 
problem: http://jira.codehaus.org/browse/WSTX-170.

At least the developer who responded to the bug report clearly states that 
attributes never belong to the default namespace.
                
> Missing namespace prefix on qualified attribute
> -----------------------------------------------
>
>                 Key: AXIS2-5449
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5449
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.6.2
>            Reporter: Thomas Raddatz
>         Attachments: TestAttributesService.wsdl
>
>
> A server skeleton generated by WSDL2JAVA does not add a namespace prefix to 
> attributes when "attributeFormDefault" is set to "true". When the web service 
> is called by a client application, the following exception is thrown:
> [ERROR] Unbound namespace URI 
> 'http://service.attributes.sample.webservice.wsdl2rpg.tools400.de/xsd'
> org.apache.axis2.AxisFault: Unbound namespace URI 
> 'http://service.attributes.sample.webservice.wsdl2rpg.tools400.de/xsd'
>       at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>       at 
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
>       at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:364)
>       at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:241)
>       at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
>       at 
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:43)
>       at 
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
>       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
>       at 
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
>       at 
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>       at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>       at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>       at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>       at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>       at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>       at 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>       at java.lang.Thread.run(Thread.java:662)
> Caused by: javax.xml.stream.XMLStreamException: Unbound namespace URI 
> 'http://service.attributes.sample.webservice.wsdl2rpg.tools400.de/xsd'
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
>       at 
> com.ctc.wstx.sw.SimpleNsStreamWriter.writeAttribute(SimpleNsStreamWriter.java:84)
>       at 
> org.apache.axiom.util.stax.wrapper.XMLStreamWriterWrapper.writeAttribute(XMLStreamWriterWrapper.java:84)
>       at 
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeAttribute(MTOMXMLStreamWriter.java:276)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.xsd.Person.writeAttribute(Person.java:581)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.xsd.Person.serialize(Person.java:402)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.xsd.Person.serialize(Person.java:377)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.xsd.Nephews.serialize(Nephews.java:135)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.xsd.Nephews.serialize(Nephews.java:108)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.GetDonaldsNephewsResponse.serialize(GetDonaldsNephewsResponse.java:105)
>       at 
> de.tools400.wsdl2rpg.webservice.sample.attributes.service.GetDonaldsNephewsResponse.serialize(GetDonaldsNephewsResponse.java:73)
>       at 
> org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:90)
>       at 
> org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:638)
>       at 
> org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
>       at 
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:267)
>       at 
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:229)
>       at 
> org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:188)
>       at 
> org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
>       ... 22 more
> This is how the message should have been serialized. Please notice the "at1" 
> prefix:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>   <soapenv:Body>
>     <ns2:getDonaldsNephewsResponse 
> xmlns:ns2="http://service.attributes.sample.webservice.wsdl2rpg.tools400.de";>
>       <ns2:return>
>         <nephews at1:gender="male" at1:vip="false" 
>                  
> xmlns="http://service.attributes.sample.webservice.wsdl2rpg.tools400.de/xsd"; 
>                  
> xmlns:at1="http://service.attributes.sample.webservice.wsdl2rpg.tools400.de/xsd";>
>           <aliases>
>             <language>German</language>
>             <name>Tick</name>
>           </aliases>
>           <aliases>
>             <language>French</language>
>             <name>Riri</name>
>           </aliases>
>           <aliases>
>             <language>Italian</language>
>             <name>Qui</name>
>           </aliases>
>           <city>Duckburg</city>
>           <firstname>Huey</firstname>
>           <lastname>Duck</lastname>
>           <email at1:type="private" at1:disabled="false" 
> at1:format="Standard" 
>                  at1:public="0">[email protected]</email>
>         </nephews>
>       </ns2:return>
>     </ns2:getDonaldsNephewsResponse>
>   </soapenv:Body>
> </soapenv:Envelope>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to