Author |
Message
|
ovasquez |
Posted: Fri Dec 28, 2007 1:10 pm Post subject: Convert XML to String |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Hi have this ESQL code:
SET OutputRoot.Properties.MessageSet = 'MS1';
SET OutputRoot.Properties.MessageType = 'Envelope';
SET OutputRoot.Properties.MessageFormat = 'XML1';
SET OutputRoot.MRM.tns:Body.ns:doDetect.ns:stringInXml=¿?
--stringInXML='<?xml version="1.0"><city><place>x</place></city>'
stringInXML is String parameter, but InputBody is a MRM XML format, how can i convert XML a simple String ¿?
Thanks. _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 28, 2007 1:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You don't seem to understand the concepts. There is no string you're in the presence of a tree. You might want to do an ESQL query...
I'd say you need some training. Request it from your management  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ovasquez |
Posted: Fri Dec 28, 2007 1:53 pm Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
i have WebServices Method: doDetect, and have only a parameter type String, same: '<?xml version="1.0"><city><place>x</place></city>'
are you underestand? _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 28, 2007 2:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So what you're saying is that you do a service call and pass the full XML message to it? It might be faster to have the broker do this simple determination...
fjb_saper wrote: |
I'd say you need some training. Request it from your management  |
_________________ MQ & Broker admin |
|
Back to top |
|
 |
ovasquez |
Posted: Wed Jan 02, 2008 4:32 pm Post subject: |
|
|
 Centurion
Joined: 09 Dec 2005 Posts: 141 Location: Lima, Peru
|
Solutions,
DECLARE MsgString CHARACTER;
DECLARE MsgBlob BLOB;
SET OutputRoot.XML =InputRoot.MRM;
SET MsgBlob = ASBITSTREAM(OutputRoot.XML OPTIONS FolderBitStream);
SET MsgString =CAST( MsgBlob AS CHARACTER CCSID 1208) ;
SET OutputRoot.XML = NULL;
SET OutputRoot.Properties.MessageSet = 'MS1';
SET OutputRoot.Properties.MessageType = 'Envelope';
SET OutputRoot.Properties.MessageFormat = 'XML1';
SET OutputRoot.MRM.tns:Body.ns:doDetect.ns:stringInXml=MsgString;
Thansk fjb_saper!!!!!!!!!!!!!!!!!!! _________________ Oscar Vásquez Flores |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 03, 2008 1:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi ovasquez,
That solution is wrong. All your attributes will become elements in the output message. It is also over-complicated and slow. Why not this:
- Parse the input message in the BLOB domain and save InputRoot.BLOB.BLOB in the local environment
- Use an RCD node to switch to the MRM domain for the main part of the message flow
- When building the output tree, retrieve the input BLOB from the local environment and add it as an MRM.Bitstream node. |
|
Back to top |
|
 |
|