Author |
Message
|
narendrach |
Posted: Wed Nov 01, 2006 12:34 pm Post subject: Problem While Creating a XML Message |
|
|
Voyager
Joined: 29 Jun 2005 Posts: 78
|
Hi
i am facing a problem while creating a XML message
my requirement is i need to propagate the XML Message from compute node twice
i am trying to create a XML message by using following code
in Environment tree i am having value like this
Environment.msgStream=<MSG><Jv-Ins-Reinsurance Version="2005-1" xmlns="http://www.ACORD.org/standards/Jv-Ins-Reinsurance/2005-1">........</MSG>
CREATE LASTCHILD OF OutputRoot
DOMAIN 'XML' PARSE (FIELDVALUE(Environment.msgStream)
ENCODING InputRoot.MQMD.Encoding
CCSID InputRoot.MQMD.CodedCharSetId);
i am able to create the message with the above code
each time i am propagating from my compute node
i need to updated different the fields in message in different ways
i am able to succesfully propagate the 1 message
and when i am trying to build 2'nd XML message by the same statement as above
CREATE LASTCHILD OF OutputRoot
DOMAIN 'XML' PARSE (FIELDVALUE(Environment.msgStream)
ENCODING InputRoot.MQMD.Encoding
CCSID InputRoot.MQMD.CodedCharSetId);
the attributes in the xml tags are becoming the Elements
Message is
<Jv-Ins-Reinsurance Version="2005-1" xmlns="http://www.ACORD.org/standards/Jv-Ins-Reinsurance/2005-1">
first time i am trying to build the message it is working fine as
<Jv-Ins-Reinsurance Version="2005-1" xmlns="http://www.ACORD.org/standards/Jv-Ins-Reinsurance/2005-1">
and secound time when i am building the message the attributes of my tag are becoming as child elements as shown below
<Jv-Ins-Reinsurance>
<Version>2005-1</Version>
<xmlns>http://www.ACORD.org/standards/Jv-Ins-Reinsurance/2005-1</xmlns>
i can able to see the 2 messages in Queue where the first message is coming correct where the secound is coming with the problem.but i am not Handling or modifying any of the attributes in message
i am not doing any operations on the msgStream variable in the environment
i have see the message while debugging, when i am trying to create the message secound time it is giving the problem attributes are becoming the elements
Environment
OS Windows
Broker 5.0 FixPac - 6
Thanks _________________ Narendra CH |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 01, 2006 12:52 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please only use the XMLNS domain on WBIMB v5.
Particularly for XML that has NameSpaces in it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Wed Nov 01, 2006 12:52 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
as i see it your output message is XMLNS domain and not XML
try parsing it as XMLNS and i think you should get the correct message
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 01, 2006 12:57 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
On the second hand, though, if you are successfully propagating once, but not twice...
Then maybe you should change your code to add a call to CopyMessageHeaders after your PROPAGATE.
And don't forget to RETURN FALSE; too.
A usual PROPAGATE loop looks like
...
While <I still need to propagate>
CopyMessageHeaders
Adjust message, including headers if needed.
PROPAGATE;
end while
return false; _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 01, 2006 2:13 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
narendrach,
Don't use the XML domain for new message flows. XMLNS is the best choice whether or not you are using namespaces.
Many users have complained about attributes turning into elements. Usually the tree has been copied to/from an environment tree which has no parser ( its root node was not CREATEd with the DOMAIN clause ).
In your case, it is only the bitstream that is stored in the environment, so that should be OK. Are you copying the message tree to/from the environment before you propagate? |
|
Back to top |
|
 |
|