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 » one tag too many in output msg

Post new topic  Reply to topic
 one tag too many in output msg « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Wed Jan 31, 2007 11:34 am    Post subject: one tag too many in output msg Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

My first test msgflow finally put a MRM XML msg to the output Q.

However it added an extra pair of tags.

What I expect is:
<?xml version="1.0" encoding="UTF-8"?>
<mc:Message xmlns:mc="http://ei.myco.com/MC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mc:ServiceName>EI::MyService</mc:ServiceName>
...
</mc:Message>

But here is what I get:
<?xml version="1.0"?>
<mc:Message xmlns:mc="http://ei.myco.com/MC" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<mc:Message>
<mc:ServiceName>EI::MyService</mc:ServiceName>
...
</mc:Message>
</mc:Message>

Why am I getting this extra skin <mc:Message>?

I set the Root Tag Name field empty. According to document, it will default to Root Tag Name setting of the msgset. But I can't even find such an entry in the msgset properties.

Also, how can I get rid of those xmlns:xml, xmlns:xsd?
How can I populate the encoding field? I set the default encoding to UTF-8 in the Properties of msgset, but it doesn't fill in the place as I expect.

I sense it must be sth trivial, can anyone point me to the right place?
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
pathipati
PostPosted: Wed Jan 31, 2007 12:02 pm    Post subject: Reply with quote

Master

Joined: 03 Mar 2006
Posts: 296

Can you post your ESQL here?
Back to top
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Wed Jan 31, 2007 12:24 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you're ESQL says "OutputRoot.MRM.Message", then this is the problem.

It should say only "OutputRoot.MRM".

You control the namespaces on the message object by changing settings on the XML properties in the model.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pcelari
PostPosted: Wed Jan 31, 2007 12:34 pm    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Here it is. Maybe my inclusion of MRM domain is responsible for this?


CREATE COMPUTE MODULE SvcRqst_ToSvc
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();

declare mb namespace 'http://ei.MyCom.com/MC';

SET OutputRoot.MRM.mc:Message.mc:MessageHeader.mc:BusinessService=
InputBody.ServiceName;

set OutputRoot.Properties.MessageSet = 'Svc_Msgset';
set OutputRoot.Properties.MessageType = 'SvcRqst';
set OutputRoot.Properties.MessageFormat = 'XML1';

RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;

END MODULE;
_________________
pcelari
-----------------------------------------
- a master of always being a newbie


Last edited by pcelari on Thu Feb 01, 2007 4:28 am; edited 1 time in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 31, 2007 12:37 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

pcelari wrote:
SET OutputRoot.MRM.mc:Message.mc:MessageHeader.mc:BusinessService=
InputBody.ServiceName;


Set OutputRoot.MRM.mc:MessageHeader.mc:BusinessService=InputBody.ServiceName;
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 31, 2007 3:10 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

hi pcelari,

Congratulations on getting this far. Here are answers to the other questions you asked:

- You cannot remove the xml declarations for xsd and xml - but they are harmless
- Assuming that you are on v6, you can ask the MRM XML writer to insert an encoding attribute in the XML decl. It will choose one based on the CCSID of the message.

If you really care about getting the exact output, build the output tree in the XMLNSC domain.
Back to top
View user's profile Send private message
pcelari
PostPosted: Thu Feb 01, 2007 4:46 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

jefflowrey wrote:
Set OutputRoot.MRM.mc:MessageHeader.mc:BusinessService=InputBody.ServiceName;


Wooow, that did the trick! Now I understand that by putting mc:Message after MRM, I forced it one level down the tree to become a child element of itself, thus the extra layer.

Thank you soooo much for all the generous helps along the way!


thanks Kimbert, I hope I'll catch up with the skills quickly so I can help other just as well.
kimbert wrote:

you can ask the MRM XML writer to insert an encoding attribute in the XML decl. It will choose one based on the CCSID of the message.
If you really care about getting the exact output, build the output tree in the XMLNSC domain.

Can you articulate a little more on this? what is MRM XML writer? I'll check the documentation on building output in the xmlnsc domain.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 01, 2007 5:15 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
what is MRM XML writer?
Sorry - I should have said 'the MRM parser'. The MRM XML writer is the component of the MRM parser which is responsible for constructing the output bitstream from a message tree.
If you look in the MRM XML message set properties you will see a property 'XML Encoding'. If that does not do what you need, you'll need to use XMLNSC instead.
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 » one tag too many in output msg
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.