Hello,

some XML Apis may optimize your XML and if a namespace already exists at the 
root-element, there is no need to define it in some element in the same 
context, except if the prefix changes. Maybe that is happening here.


Regards,

Marko Voß



-----Original Message-----
From: vitomeuli [mailto:vitome...@libero.it] 
Sent: Wednesday, July 27, 2011 4:52 PM
To: jibx-users@lists.sourceforge.net
Subject: Re: [jibx-users] Declaring xsi and xsd namespaces in both SOAP 
Envelope and Body content


Hello Marko,


Voß, Marko wrote:
> 
> ...
> It is strange, that those namespaces are missing in your XML, because your
> binding is correct. I would guess, that some part of your APIs is removing
> them after marshalling is done by JiBX. 
> 

I think this is the real point.

In my interceptor, executing at the very end of the response generation
process, after the JiBX marshalling I guess, I had some code to add such 2
namespaces to the <soap:Envelope>, root of the whole document.
This works, they are where they are supposed to be. 
But the 2 namespaces are not in the contained XML element
<OTA_HotelResNotifRS> mashalled from JiBX.
--------
<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:Header>
   </soap:Header>
   <soap:Body>
      <OTA_HotelResNotifRS xmlns="http://www.opentravel.org/OTA/2003/05";>
         <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>
--------

The other way round, if I remove that code, magically the 2 namespaces
appear in the desiderd XML element <OTA_HotelResNotifRS>!
--------
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; >
   <soap:Header>
   </soap:Header>
   <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>
--------

So I think it is redundant to declare them twice, and some API (I don't know
which one) builds the final XML (SOAP and everything) declaring them only
once: they can be in the <soap:Envelope> root element, or in the contained
XML element <OTA_HotelResNotifRS>, but not in both ones.

I'm trying to argument this point with the support contact of the other
company, I hope they accept my  explanation.

Many thanks!
Cheers,
Vito
-- 
View this message in context: 
http://old.nabble.com/Declaring-xsi-and-xsd-namespaces-in-both-SOAP-Envelope-and-Body-content-tp32146703p32148618.html
Sent from the jibx-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to