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 » Redefining namespace in a child tag - need help please

Post new topic  Reply to topic
 Redefining namespace in a child tag - need help please « View previous topic :: View next topic » 
Author Message
ydsk
PostPosted: Mon Oct 17, 2005 2:42 pm    Post subject: Redefining namespace in a child tag - need help please Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Hi,

Here is my input message:
-----------------------------------------------------
<MYNS:Envelope xmlns:MYNS="http://www.xmlschema.com/addressing">
<...some elements ...>
<URNS:Header xmlns:URNS="http://www.xmlschema.com/addressing">
<URNS:Header1>
<tag1>1234</tag1>
</URNS:Header1>
</URNS:Header >
<Body>
<tag2>tag2value</tag2>
</Body>
</MYNS:Envelope>
-----------------------------------------------------

and here is my ESQL code ( just 1 compute node between MQInput and MQOutput nodes):
-------------------------------------------------------
CALL CopyMessageHeaders();
DECLARE soapenv NAMESPACE http://www.xmlschema.com/addressing';
DECLARE ref REFERENCE TO InputRoot.XMLNS.soapenv:Envelope;
MOVE ref FIRSTCHILD;
NMS:WHILE (FIELDNAME(ref) <> 'Header') DO

CREATE LASTCHILD OF OutputRoot.XMLNS.soapenv:Envelope FROM ref;

MOVE ref NEXTSIBLING;

END WHILE NMS;
CREATE LASTCHILD OF OutputRoot.XMLNS.soapenv:Envelope FROM ref;
SET OutputRoot.XMLNS.soapenv:Envelope.soapenv:Header.soapenv:NEWTAG = 'some value';
-------------------------------------------------------------

And here is the output I am getting:
-----------------------------------------------------
<MYNS:Envelope xmlns:MYNS="http://www.xmlschema.com/addressing">
<...some elements ...>
<MYNS:Header xmlns:URNS="http://www.xmlschema.com/addressing">
<MYNS:Header1>
<tag1>1234</tag1>
</MYNS:Header1>
<MYNS:NEWTAG>some value</MYNS:NEWTAG>
</MYNS:Header >
<Body>
<tag2>tag2value</tag2>
</Body>
</MYNS:Envelope>
-----------------------------------------------------

I want the prefix URNS to be preserved in the output but it's getting converted to MYNS in the output because the namespace URL that was defined in the Envelope tag as MYNS was redefined in the Header tag as URNS, in the input message. But the original definition of namespace seems to be over-riding the re-defined namespace.

Can anyone pls tell me how to get the redefined namespace prefix URNS in the output (for Header and its children ) ?

Thanks for your time.
Back to top
View user's profile Send private message
ydsk
PostPosted: Mon Oct 17, 2005 2:52 pm    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Sorry, pls ignore the <Body> tag entirely in the Output message. I am not copying it from InputRoot to OutputRoot and so, it wouldn't appear in Output message that I posted above. -- that's a small correction.

Thanks.
ydsk.
Back to top
View user's profile Send private message
ydsk
PostPosted: Mon Oct 17, 2005 5:31 pm    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Can somebody pls help me with my problem described above ?

Thanks.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Oct 18, 2005 3:50 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

ydsk,
I don't think this will be possible - although I'm very happy to be corrected on that point. I don't think the prefix assignment logic copes with your scenario.
Question: Strictly speaking, a namespace prefix is just an alias for the namespace. Why does it matter what the prefix is?
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Oct 18, 2005 6:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi ydsk,
The good news is that it works on v5 CSD4. I don't know what version you are using, but if you upgrade to the latest CSD, you will find that it works.
It also works on v6, which is an even better upgrade path
Back to top
View user's profile Send private message
ydsk
PostPosted: Tue Oct 18, 2005 7:54 am    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Hi Kimbert,
I am on version 5 CSD4 too.

Can you pls send me the ESQL code that worked ?

Appreciate your help.

Thank you very much.
ydsk.
Back to top
View user's profile Send private message
ydsk
PostPosted: Tue Oct 18, 2005 8:00 am    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

I don't want to copy the entire message ( OutputRoot=InputRoot) and then make OutputRoot.Body = NULL. .... I can't do that because the <Body> tag can have data as big as an MB or more.

Pls give me the ESQL code that does what I need.

Thanks.
Back to top
View user's profile Send private message
juddg
PostPosted: Wed Oct 19, 2005 12:21 am    Post subject: Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi ydsk,
Kimbert is now on vacation. When he ran his test he used the ESQL that you posted. The only thing that needed to be changed was to put a single quote at the start of the URI in the declaration of soapenv. It was assumed that this was just a typo in the post. As input he used your posted input message with the '<...some elements ...>' line removed. The flow consisted of an MQInput, Compute and MQOutput node. The 'Message Domain' on the MQInput node was set to XMLNS.

Regards,

juddg.
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 » Redefining namespace in a child tag - need help please
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.