Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5449

Missing namespace prefix on qualified attribute

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: codegen
    • Labels:
      None

      Description

      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">tick.duck@duckburg.com</email>
      </nephews>
      </ns2:return>
      </ns2:getDonaldsNephewsResponse>
      </soapenv:Body>
      </soapenv:Envelope>

        Attachments

        1. TestAttributesService.wsdl
          7 kB
          Thomas Raddatz

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tools400 Thomas Raddatz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: