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 » Adding namespaces to existing message

Post new topic  Reply to topic Goto page Previous  1, 2
 Adding namespaces to existing message « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Wed Sep 02, 2009 7:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Once more, with feeling.

Adding a namespace declaration to the message tree does NOTHING to add namespace values to nodes in the message tree.

It's as simple and straightforward and plain as
kimbert wrote:
Sorry, there is no shortcut. Every individual node in the message tree must have the correct namespace assigned to it.


So if you want to get "(0x01000000)http://www.amica.com/amica_messaging:KeyGroup", then you need to say "msg:KeyGroup", and likewise for EVERY NODE IN THE TREE.
Back to top
View user's profile Send private message
Sandman
PostPosted: Wed Sep 02, 2009 7:05 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2001
Posts: 134
Location: Lincoln, RI

Thanks for your patience folks.

But when I tried saying "msg:KeyGroup", etc., I ended up w/ a NEW element in my output message, IN ADDITION to the existing non-namespaced one that came in on the input message. Do I need to NOT CopyEntireMessage upfront, and instead, copy just the headers, then move each piece from input to output separately (so that I can include the msg: prefix and only end up w/ 1 copy of each element)?
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed Sep 02, 2009 8:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5543
Location: Southampton

Quote:
Do I need to NOT CopyEntireMessage upfront, and instead, copy just the headers, then move each piece from input to output separately (so that I can include the msg: prefix and only end up w/ 1 copy of each element)?
I know, but I'm not telling. It is obvious that you are not completely up to speed with message flow development. Finding the answer is as simple as attaching the debugger and stepping through your ESQL. By doing that, you will gain some useful experience in developing and debugging message flows.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 02, 2009 8:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'm confused.

Are you asking how to SET the NAMESPACE on an Element?
Back to top
View user's profile Send private message
Sandman
PostPosted: Wed Sep 02, 2009 10:28 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2001
Posts: 134
Location: Lincoln, RI

Yes, I was asking how to set the namespace. I've never had a need to do this to an existing XML message (most of ours have namespaces already). And in our MRM->XML transformations, I've always used a namespace constant (i.e. SET OutputRoot.XMLNS.msg:Message...) to setup the namespaces. But in the latter case, it was creating a whole new XML tree, not adding namespaces to an existing one.

That does NOT imply that I'm a total broker newb just because I'm a tad namespace-challenged. Last I checked, there's a whole lot of other concepts, many of which I'm far more comfortable w/ than namespaces. But thanks for the vote of confidence, NTL!

I ended up finding this syntax:
Code:
SET FieldRefPtr NAMESPACE = '';
...in this thread: http://www.mqseries.net/phpBB2/viewtopic.php?t=25039

So to add the namespaces where I needed them, I did:
Code:
DECLARE msg NAMESPACE 'http://www.amica.com/amica_messaging';
SET OutputRoot.XMLNS.Message NAMESPACE = msg;
SET OutputRoot.XMLNS.msg:Message.CrfActionGroup NAMESPACE = msg;
SET OutputRoot.XMLNS.msg:Message.msg:CrfActionGroup.CommandReference NAMESPACE = msg;
SET OutputRoot.XMLNS.msg:Message.msg:CrfActionGroup.KeyGroup NAMESPACE = msg;
SET OutputRoot.XMLNS.msg:Message.msg:CrfActionGroup.msg:KeyGroup.AlternateId NAMESPACE = msg;
SET OutputRoot.XMLNS.msg:Message.msg:CrfActionGroup.msg:KeyGroup.UUID NAMESPACE = msg;

Then I sent this modified message through a subflow that required namespaces on the Message and CrfActionGroup. So upon return from that subflow, I needed to strip the namespaces (and just delete the CrfActionGroup):
Code:
SET OutputRoot.XMLNS.msg:Message.msg:CrfActionGroup = NULL;
SET OutputRoot.XMLNS.msg:Message NAMESPACE = '';

It seems to be working fine now. Have I missed some key concept and planted some time bomb?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Adding namespaces to existing message
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.