Announcement Announcement Module
Collapse
No announcement yet.
howto change isRepairingNamespaces in XMLOutputFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • howto change isRepairingNamespaces in XMLOutputFactory

    Hi List!
    I'm putting hands in places not well known to me, because I'm really desperate :-)

    I'm writing a web service where I have to produce a SOAP message like the following:
    Code:
    <soap:Envelope
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    ...
       <soap:Body>
          <OTA_HotelResNotifRS
            xmlns="http://www.opentravel.org/OTA/2003/05"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <Errors>
                <Error Type="1">Found 1 valid reservations with CRS Confirmation Number=52690IC0000172, there should be none.</Error>
             </Errors>
          </OTA_HotelResNotifRS>
       </soap:Body> 
    </soap:Envelope>
    Please note the xsi and xsd namespaces are declared twice: both in the <soap:Envelope> and in the <OTA_HotelResNotifRS> element.

    The other company consuming my messages requires such a strange (to me) message, and I'm not able to let them come out.
    I can get the 2 namespaces declared only once: only in the <soap:Envelope> or only in the <OTA_HotelResNotifRS> element, but not in both at the same time.

    I think it's the XMLStreamWriter that is "optimizing" the outgoing XML, maybe because of isRepairingNamespaces=true.
    This is what I guess, but my understanding is really vague.
    Can somebody advice if my guess is correct, and how I can try and set that isRepairingNamespaces to false? Is there a better way to accomplish this?

    I'm using Spring-WS 2.0.1 with an AxiomSoapMessageFactory and a JiBX marshaller 1.2.3.

    Any hint would be much appreciated.
    Cheers,
    Vito Meuli
Working...
X