I don't have any explanation out of my head, but I don't think the xml
is incorrect.
AFAIK, having xmlns="" forces the namespace to not be bound (which
would be also the case in this very example because no parent has
xmlns="xxx" set, but it might happen).
Also, even if the declaration of the ws addressing namespace isn't
used, it's not illegal either.
If you process the message with a correct xml parser, they should be
semantically equivalent I think.

On Fri, Jul 3, 2009 at 10:40, Diefenbach Anne<[email protected]> wrote:
> Sorry, I have to ask again. Is there any explanation for this behaviour? I 
> would not have expected the broker to even look at the business message 
> contained in the <Message> tags.
>
> Regards,
>
> Anne
>
>> -----Ursprüngliche Nachricht-----
>> Von: Diefenbach Anne [mailto:[email protected]]
>> Gesendet: Donnerstag, 25. Juni 2009 17:08
>> An: [email protected]
>> Betreff: WSN2005 with CXF-BC: Weird namespaces for nested elements
>>
>> Hi,
>>
>> I was comparing the messages sent from notification producer to broker
>> and from broker to consumer, and noticed they differ rather
>> considerably. Some of that can be explained by the fact that my producer
>> uses FUSE Services Framework 2.1.3.1 and the broker the probably much
>> newer servicemix-cxf-bc-2009.01, but what I thought was really weird was
>> the way the latter treated the elements which in my schema [1] are
>> defined nested in another complex type. This is the message CXF gave:
>>
>> <soap:Envelope
>> xmlns:soap="http://www.w3.org/2003/05/soap-envelope";><soap:Body><ns6:Not
>> ify xmlns:ns2="http://www.w3.org/2005/08/addressing";
>> xmlns:ns3="http://docs.oasis-open.org/wsrf/bf-2";
>> xmlns:ns4="http://docs.oasis-open.org/wsn/t-1";
>> xmlns:ns5="http://docs.oasis-open.org/wsn/br-2";
>> xmlns:ns6="http://docs.oasis-open.org/wsn/b-2";
>> xmlns:ns7="http://katastropheneinsatz.fgan.de";
>> xmlns:ns8="http://docs.oasis-open.org/wsrf/r-2";><ns6:NotificationMessage
>> ><ns6:Topic
>> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple";>Envi
>> ronmentReport</ns6:Topic><ns6:Message><ns7:environmentReport><ns7:enviro
>> nment><ns7:weather><location>Bonn</location><temperature
>> system="Celsius">15.0</temperature><wind>medium</wind><precipitation>Dri
>> zzle</precipitation></ns7:weather></ns7:environment></ns7:environmentRep
>> ort></ns6:Message></ns6:NotificationMessage></ns6:Notify></soap:Body></s
>> oap:Envelope>
>>
>> That's exactly how I would have expected it. With the CXF-BC however, I
>> get:
>>
>> <soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:N
>> otify xmlns="http://www.w3.org/2005/08/addressing";
>> xmlns:ns2="http://docs.oasis-open.org/wsn/b-2";
>> xmlns:ns3="http://docs.oasis-open.org/wsrf/bf-2";
>> xmlns:ns4="http://docs.oasis-open.org/wsrf/rp-2";
>> xmlns:ns5="http://docs.oasis-open.org/wsn/t-1";><ns2:NotificationMessage>
>> <ns2:Topic
>> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple";>Envi
>> ronmentReport</ns2:Topic><ns2:Message><ns7:environmentReport
>> xmlns:ns7="http://katastropheneinsatz.fgan.de";><ns7:environment><ns7:wea
>> ther><location xmlns=""
>> xmlns:ns7_="http://www.w3.org/2005/08/addressing";>Bonn</location><temper
>> ature system="Celsius" xmlns=""
>> xmlns:ns7_="http://www.w3.org/2005/08/addressing";>15.0</temperature><win
>> d xmlns=""
>> xmlns:ns7_="http://www.w3.org/2005/08/addressing";>medium</wind><precipit
>> ation xmlns=""
>> xmlns:ns7_="http://www.w3.org/2005/08/addressing";>Drizzle</precipitation
>> ></ns7:weather></ns7:environment></ns7:environmentReport></ns2:Message><
>> /ns2:NotificationMessage></ns2:Notify></soap:Body></soap:Envelope>
>>
>> Why does it add the xmlns="" and
>> xmlns:ns7_="http://www.w3.org/2005/08/addressing";? Is this intended
>> behaviour?
>>
>> Regards,
>>
>> Anne
>>
>> [1]
>>     <xsd:schema elementFormDefault="unqualified"
>>       targetNamespace="http://katastropheneinsatz.fgan.de";
>> xmlns="http://katastropheneinsatz.fgan.de";>
>>       <xsd:attribute name="priority">
>>         <xsd:simpleType>
>>           <xsd:restriction base="xsd:string">
>>             <xsd:enumeration value="emergency"/>
>>             <xsd:enumeration value="high"/>
>>             <xsd:enumeration value="default"/>
>>             <xsd:enumeration value="low"/>
>>           </xsd:restriction>
>>         </xsd:simpleType>
>>       </xsd:attribute>
>>       <xsd:element name="weather">
>>         <xsd:complexType>
>>           <xsd:sequence>
>>             <xsd:element name="location" type="xsd:string"/>
>>             <xsd:element name="temperature">
>>               <xsd:complexType mixed="true">
>>                 <xsd:simpleContent>
>>                   <xsd:extension base="xsd:decimal">
>>                     <xsd:attribute default="Celsius" name="system">
>>                       <xsd:simpleType>
>>                         <xsd:restriction base="xsd:string">
>>                           <xsd:enumeration value="Celsius"/>
>>                           <xsd:enumeration value="Kelvin"/>
>>                           <xsd:enumeration value="Fahrenheit"/>
>>                         </xsd:restriction>
>>                       </xsd:simpleType>
>>                     </xsd:attribute>
>>                   </xsd:extension>
>>                 </xsd:simpleContent>
>>               </xsd:complexType>
>>             </xsd:element>
>>             <xsd:element name="wind">
>>               <xsd:simpleType>
>>                 <xsd:restriction base="xsd:string">
>>                   <xsd:enumeration value="stormy"/>
>>                   <xsd:enumeration value="strong"/>
>>                   <xsd:enumeration value="medium"/>
>>                   <xsd:enumeration value="weak"/>
>>                   <xsd:enumeration value="none"/>
>>                 </xsd:restriction>
>>               </xsd:simpleType>
>>             </xsd:element>
>>             <xsd:element name="precipitation">
>>               <xsd:simpleType>
>>                 <xsd:restriction base="xsd:string">
>>                   <xsd:enumeration value="Fog"/>
>>                   <xsd:enumeration value="Drizzle"/>
>>                   <xsd:enumeration value="Rain"/>
>>                   <xsd:enumeration value="Freezing drizzle"/>
>>                   <xsd:enumeration value="Freezing rain"/>
>>                   <xsd:enumeration value="Snow"/>
>>                   <xsd:enumeration value="Snow grains"/>
>>                   <xsd:enumeration value="Ice pellets"/>
>>                   <xsd:enumeration value="Graupel"/>
>>                   <xsd:enumeration value="Ice crystals"/>
>>                 </xsd:restriction>
>>               </xsd:simpleType>
>>             </xsd:element>
>>           </xsd:sequence>
>>         </xsd:complexType>
>>       </xsd:element>
>>       <xsd:element name="environment">
>>         <xsd:complexType>
>>           <xsd:sequence>
>>             <xsd:element maxOccurs="unbounded" ref="tns:weather"/>
>>           </xsd:sequence>
>>         </xsd:complexType>
>>       </xsd:element>
>>       <xsd:element name="environmentReport">
>>         <xsd:complexType>
>>           <xsd:sequence>
>>             <xsd:element ref="tns:environment"/>
>>           </xsd:sequence>
>>         </xsd:complexType>
>>       </xsd:element>
>>     </xsd:schema>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply via email to