Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-427

Namespace prefix in attribute value not resolved correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: Version 2.4
    • Fix Version/s: Version 2.5
    • Component/s: Binding
    • Labels:
      None

      Description

      I have following SOAP request.

      <soapenv:Envelope xmlns:ns="http://schemas.qqq.com/wsdl/spi/profile/1.0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header/>
      <soapenv:Body>
      <ns:getRights>
      <ns:customerCredential xsi:type="ns:CustomerCredentialMsisdn">
      <ns:msisdn>420123456789</ns:msisdn>
      </ns:customerCredential>
      </ns:getRights>
      </soapenv:Body>
      </soapenv:Envelope>

      I only need to bind the payload:

      <ns:getRights>
      <ns:customerCredential xsi:type="ns:CustomerCredentialMsisdn">
      <ns:msisdn>420123456789</ns:msisdn>
      </ns:customerCredential>
      </ns:getRights>

      Please note that namespace prefix ns is not defined. Usually this is not a problem since in DOM namespaces are already resolved. There is one exception - attribute value. When XmlBeans try to unmarshall the element, they are not able to resolve the namespace and do not work correctly.

      If following request is used (the only difference is position of ns prefix declaration) everything works fine

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Header/>
      <soapenv:Body>
      <ns:getRights xmlns:ns="http://schemas.qqq.com/wsdl/spi/profile/1.0">
      <ns:customerCredential xsi:type="ns:CustomerCredentialMsisdn">
      <ns:msisdn>420123456789</ns:msisdn>
      </ns:customerCredential>
      </ns:getRights>
      </soapenv:Body>
      </soapenv:Envelope>

        Attachments

        1. test-ws-1.0-SNAPSHOT-src.zip
          6 kB
          Lukas Krecan

          Activity

            People

            • Assignee:
              cezar Cezar Cristian Andrei
              Reporter:
              lukas@krecan.net Lukas Krecan
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: