1 Reply Latest reply on May 13, 2010 3:34 AM by Sergey Chernov

    Envelope XML structure with multiply NS definitions of same namespace

    Sergey Chernov Newbie

      Good day, All!

       

      I've noticed, that WS defines namespace for each tag or attribute, when namespace is out of service namespace.

      Like this:

      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
          <env:Header/>
          <env:Body>
             <ns2:getNilElementResponse xmlns:ns2="http://service.domain.com/">
                <return>
                   <values>
                      <records>test</records>
                      <records xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
                      <records>test1</records>
                      <records xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
                   </values>
                </return>
             </ns2:getNilElementResponse>
          </env:Body>
      </env:Envelope>

       

      As you can see attribute `nil` is from XMLSchema-instance namespace. The namespace prefix definition apears each time `nil` is used.

      In case of small response (like this) it is not big problem, but when huge amount of data returned - it causes extra overhead.

       

      Is there any way to define such namespaces in parent node (body)?

      I have created feature request JBWS-3021