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 » General Discussion » Namespaces in message flows

Post new topic  Reply to topic
 Namespaces in message flows « View previous topic :: View next topic » 
Author Message
gus
PostPosted: Thu Aug 31, 2006 8:35 am    Post subject: Namespaces in message flows Reply with quote

Apprentice

Joined: 10 Apr 2002
Posts: 36

Good morning,

I am trying to figure out the best way to convert our existing flows to use a new format of the incoming XML with perfixed namespaces. Below is currently the way our incoming request would look like:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<person xmlns:pers="http://sernaferna.com/pers" xmlns:html="http://www.w3.org/1999/xhtml">
<name>
<first>John</first>
<last>DOE</last>
</name>
</person>


What they want it to look like now is:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<pers:person xmlns:pers="http://sernaferna.com/pers" xmlns:html="http://www.w3.org/1999/xhtml">
<pers:name>
<pers:first>John<pers:/first>
<pers:last>DOE<pers:/last>
<pers:/name>
<pers:/person>

I have about 350 flows that will need to be modified for this change. What is going to be my easiest way to do this? any help would be great.

Thank you
Back to top
View user's profile Send private message
dgolding
PostPosted: Thu Aug 31, 2006 8:49 am    Post subject: Reply with quote

Yatiri

Joined: 16 May 2001
Posts: 668
Location: Switzerland

Good evening


echo '<?xml version="1.0" encoding="ISO-8859-1" ?>' > hdr
for i in *.htm # Or whatever filename convention you're using
do
cp -p $i $i.SAFE
cat $i|grep -v "xml version"|sed "s/\</\<pers:/g">tail
cat hdr tail > $i

done
rm hdr tail

This is assuming of course, according to the spec I've just seen that everthing that ISN'T "xml version" wants to have this namespace thing

Be REALLY SURE you take a backup before you do this!

Use at your own risk, E&OE, YMMV

A Perl script would be better and probably a lot more portable but I can't be bothered....

I assume you're using a real operating system that allows shell scripting (i.e. not Windows) if not you could probably do this using Cygwin on Windows.
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Thu Aug 31, 2006 9:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So you need to update 350 flows to change the interface that the flows expect?

Dgolding's solution isn't going to work for that.

This is a case where using MRM XML would make your life easy - you would have to only change one message set.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
gus
PostPosted: Thu Aug 31, 2006 9:28 am    Post subject: Reply with quote

Apprentice

Joined: 10 Apr 2002
Posts: 36

The sample I gave is just one of many xml request. I am just trying to figure out a way to not have to change all the flows and re-deploy all of them. I am thinking of maybe putting transformation layer in the messaging server to strip off the namespace then put it back in after the unit of work is done inside the flows. I was hoping there was someway to ignore the namespace when the message hit the input node of the flow and allow the flow to process the message as normal.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Aug 31, 2006 9:39 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You could certainly add another message flow that would transform messages from the new interface into the old interface.

Then you'd just have to make sure that everyone's messages went there first, and that you can figure out where they were supposed to go next.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Aug 31, 2006 6:19 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

How about adding the attribute elementFormDefault="qualified" to your xml declaration???

Don't know if the standard MRM would pick this up and generate the tags...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Namespaces in message flows
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.