ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML element order and WMB serializers?

Post new topic  Reply to topic
 XML element order and WMB serializers? « View previous topic :: View next topic » 
Author Message
sleepyjamie
PostPosted: Wed Sep 16, 2015 12:35 pm    Post subject: XML element order and WMB serializers? Reply with quote

Centurion

Joined: 29 Apr 2015
Posts: 135

I am wondering how the Message Broker serializers handles ordering of the XML elements during serialization.

For example:

DECLARE 'ns' NAMESPACE 'http://www.somenamespace.com/MyData'

SET OutputRoot.XMLNSC.ns:MyData.Element2 = 'Value2';
SET OutputRoot.XMLNSC.ns:MyData.Element1 = 'Value1';

If the schema requires Element1 to be before the Element2, I am wondering if Message Broker can order the elements when serializing, regardless on how the developer sets them in the tree hierarchy.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 16, 2015 2:16 pm    Post subject: Re: XML element order and WMB serializers? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sleepyjamie wrote:
I am wondering if Message Broker can order the elements when serializing, regardless on how the developer sets them in the tree hierarchy.


Not so far as I'm aware, and broker doesn't even care if the serialized XML matches the schema unless the developer has indicated that the XML should be validated.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
timber
PostPosted: Wed Sep 16, 2015 2:43 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

This is a standard FAQ for WMB / IIB.

WMB and IIB will serialize the XML in the order in which the elements appear in the tree. So the only way to get your output in the correct order is to build the tree in the correct order.
That can be a real pain if you are using ESQL or plain Java. It's guaranteed for you if you use
a) the Mapping node or
b) a JavaCompute node with JAXB classes generated from the schemas.

For those who are determined to use Java in their message flows, b) is a pretty good option anyway.
Back to top
View user's profile Send private message
sleepyjamie
PostPosted: Thu Sep 17, 2015 6:14 am    Post subject: Reply with quote

Centurion

Joined: 29 Apr 2015
Posts: 135

thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML element order and WMB serializers?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.