Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-509

Namespace prefix in attribute value not resolved correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.5.7
    • Component/s: Core
    • 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>

      When umarshalling is called only the payload is passed to the unmarshaller. So DOM equivalent of following is used

       
      <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. I assume that Spring-WS should somehow take this situation into account.

      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>

        Issue Links

          Activity

          dart0 Lukas Krecan created issue -
          arjen.poutsma Arjen Poutsma made changes -
          Field Original Value New Value
          Fix Version/s 1.5.7 [ 11173 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue duplicates SWS-502 [ SWS-502 ]
          arjen.poutsma Arjen Poutsma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is related to SWS-523 [ SWS-523 ]
          arjen.poutsma Arjen Poutsma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              dart0 Lukas Krecan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: