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 » Output as XML message

Post new topic  Reply to topic
 Output as XML message « View previous topic :: View next topic » 
Author Message
jfecq
PostPosted: Wed Feb 27, 2013 6:54 pm    Post subject: Output as XML message Reply with quote

Apprentice

Joined: 24 Sep 2012
Posts: 36

Hi, I need to use broker to output a XML message to a remote queue. Using ESQL,

Code:

-- this?
SET OutputRoot."BLOB"."BLOB" = xmlAsBlob;

-- or this?
SET OutputRoot.XMLNSC = xmlString;


which one should I use? Or both are incorrect?
Because if I use
Code:
SET OutputRoot.XMLNSC = xmlString;
I got the error

No root element was found while writing the XML message.


xmlString is a standard xml as below.

Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<A>1</A>
<B><C>2</C></B>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Feb 27, 2013 9:51 pm    Post subject: Reply with quote

Grand High Poobah

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

Broker 101

SET OutputRoot.XMLNSC.(somestuff) expects the XML to be in form of a message tree.

SET OutputRoot.BLOB.BLOB will take any content for the BLOB value. It will essentially hold a BITSTREAM...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jfecq
PostPosted: Wed Feb 27, 2013 9:55 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Sep 2012
Posts: 36

Therefore I should used SET OutputRoot.BLOB.BLOB? Since the other party expects the whole xml including <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Feb 27, 2013 10:01 pm    Post subject: Reply with quote

Grand High Poobah

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

jfecq wrote:
Therefore I should used SET OutputRoot.BLOB.BLOB? Since the other party expects the whole xml including <?xml version="1.0" encoding="UTF-8" standalone="yes"?>


Make sure the BLOB is in UTF-8 and the message properties show CCSID = 1208.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jfecq
PostPosted: Wed Feb 27, 2013 10:18 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Sep 2012
Posts: 36

These are enough?

Code:

SET OutputRoot.Properties.CodedCharSetId=1208;
SET OutputRoot.MQMD.CodedCharSetId = 1208;
DECLARE xmlAsBlob BLOB CAST(InputRoot.SOAP.Body.xml AS BLOB CCSID(1208));


Thanks!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Feb 28, 2013 4:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

jfecq wrote:
These are enough?

Code:

SET OutputRoot.Properties.CodedCharSetId=1208;
SET OutputRoot.MQMD.CodedCharSetId = 1208;
DECLARE xmlAsBlob BLOB CAST(InputRoot.SOAP.Body.xml AS BLOB CCSID(1208));


Thanks!


No.

That won't do anything.

And, no, you DO NOT NEED TO DO THIS to send to an MQOutput node.

The MQOutput node is perfectly capable of taking any kind of logical message tree and using the necessary properties and parser to convert it to a physical message.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Feb 28, 2013 5:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

fjb_saper wrote:
Broker 101


I think you mean WM664 ?

https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM664


https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM674
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Thu Feb 28, 2013 6:09 am    Post subject: Reply with quote

Grand High Poobah

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

lancelotlinc wrote:
fjb_saper wrote:
Broker 101


I think you mean WM664 ?

https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM664


https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM674


Thanks, I knew you'd pick up the training reference!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Thu Feb 28, 2013 6:15 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

fjb_saper wrote:
lancelotlinc wrote:
fjb_saper wrote:
Broker 101


I think you mean WM664 ?

https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM664


https://www-304.ibm.com/services/learning/content/ites.wss/us/en?pageType=course_description&courseCode=WM674


Thanks, I knew you'd pick up the training reference!


Most welcome, sir.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
jfecq
PostPosted: Thu Feb 28, 2013 5:51 pm    Post subject: Reply with quote

Apprentice

Joined: 24 Sep 2012
Posts: 36

mqjeff wrote:

No.

That won't do anything.

And, no, you DO NOT NEED TO DO THIS to send to an MQOutput node.

The MQOutput node is perfectly capable of taking any kind of logical message tree and using the necessary properties and parser to convert it to a physical message.



So I will just only need to code this?

SET OutputRoot."BLOB"."BLOB" = xmlAsBlob;
Back to top
View user's profile Send private message
rekarm01
PostPosted: Fri Mar 01, 2013 2:32 am    Post subject: Re: Output as XML message Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

jfecq wrote:
Hi, I need to use broker to output a XML message to a remote queue. Using ESQL,

Code:
-- this?
SET OutputRoot."BLOB"."BLOB" = xmlAsBlob;

-- or this?
SET OutputRoot.XMLNSC = xmlString;

The "BLOB" doesn't need double-quotes. The choice of parser only affects the internal representation of the parsed message. Both the BLOB and XMLNSC parsers can output an XML message; it should look the same either way. But the XMLNSC parser can also ensure that output messages are well-formed, and validate them against a schema.

jfecq wrote:
Because if I use

Code:
SET OutputRoot.XMLNSC = xmlString;

I got the error

No root element was found while writing the XML message.

The documentation describes the XMLNSC logical message tree structure in more detail. Simply assigning an unparsed character string won't work.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Mar 01, 2013 6:51 am    Post subject: Re: Output as XML message Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

jfecq wrote:

Because if I use
Code:
SET OutputRoot.XMLNSC = xmlString;
I got the error

No root element was found while writing the XML message.


xmlString is a standard xml as below.

Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<A>1</A>
<B><C>2</C></B>


Your xmlString variable does not contain valid XML. That is probably why you got the 'No root element was found' error.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 01, 2013 6:54 am    Post subject: Re: Output as XML message Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

joebuckeye wrote:
jfecq wrote:

Because if I use
Code:
SET OutputRoot.XMLNSC = xmlString;
I got the error

No root element was found while writing the XML message.


xmlString is a standard xml as below.

Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<A>1</A>
<B><C>2</C></B>


Your xmlString variable does not contain valid XML. That is probably why you got the 'No root element was found' error.


It's also a string not a message tree. This is not going to help.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Mar 01, 2013 7:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

In order to be successful using Broker, you must learn and understand how to construct and manipulate logical message trees.

This is an entirely separate operation than working with physical messages.

Until you stop thinking about physical messages, and BLOBs and bitstreams, you will not start thinking about logical message trees.

It's certainly easy and possible to write code that will construct logical message trees from bitstreams, and construct bitstreams from logical message trees inside Broker.

None of the code you have posted makes any attempt to do that.

And it's usually not a necessary task to do either thing.
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 » Output as XML 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.