|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Converting BLOB to XML |
« View previous topic :: View next topic » |
Author |
Message
|
cadenza |
Posted: Thu Jul 15, 2004 4:56 am Post subject: Converting BLOB to XML |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 48
|
Hi,
I am working in WMQI 2.1, facing a problem while converting a BLOB message to XML. I have the input message in a report format like this:
A B C D E
111/^222../^333/^444/^555
Where A, B, C, D, E are the elements in the message.
Can anyone help me to convert this input message into XML format?
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 15, 2004 10:20 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Why are you calling your message as BLOB message? It seems the message has some format that can be modeled with TDS wire format using MRM. You can say that your input elements are delimited by /^ char.
After reading the message from input queue parse the message using TDS message definition. In a compute node you can then write some ESQL code to transform your input message to XML format. For example,
Code: |
SET OutputRoot.XML.MyMessage.A = InputRoot.MRM.A;
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
cadenza |
Posted: Thu Jul 15, 2004 10:00 pm Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 48
|
Hi,
First of all I thank you for your prompt response. I am sorry for not being able to explain the problem to you.
Currently there is an application which generates a report message for displaying some data. This message (in report format) will be sent to an input queue. We need to parse this message and generate a suitable XML.
The problems are :
a) The report format doesnt indicate any consistency
b) Messages within report like the following cannot be predicted before-hand:
"* * * NO DATA AVAILABLE * * *"
( in Sample Report 2 below)
c) There are several such variations of messages.
I am sending two samples of such input messages. I have seen several
variations in input.
Note: Everyting between the lines earmarked as ///// constitute the message.
Sample Report 1
////////////////////////////////////////////////////////////////////////
Line#
1) SRC ALIGHT DATE SAP ARR MT TIME RANK DW
2) >CURSTA/^KWI/^ALL../^15DEC81/^ALL/^ALL/^../^0000-^1610/^./
3) MT JACD STAT CUR STAT RESORT DEAL/C FLT STE,TA IA/RT/DO LOC
4) -- --- ---- ---- ---- ------- ------ ------------------ ---
5) A 215 0320 FAX JLT L-BIFL MORBID,SH T/O
6) L-5
7)
8) L-20/X 9060/01-45/ FD,N,T,Z,P,
9) Q,R,S,T,U,V,
10) W,X,Y,Z
10) L-27/Y 6785/01-45/& FD,N,T,O,P,
11) R,T,U,V,W,X,
12) Q,R,S,T,U
13)
14) G 512 0110 JKT ZYP L-BIFL LOPEZ,JE T/O
15) L-2 *
16) ROLL-UP FOR MORE INFORMATION PAGE 1 OF 10 >KT
/////////////////////////////////////////////////////////////////////////
Sample Report 2
/////////////////////////////////////////////////////////////////////////
Line#
1) SRC ALIGHT DATE SAP ARR MT TIME RANK DW
2) >CURSTA/^KWI/^ALL../^15DEC81/^ALL/^ALL/^../^0000-^1610/^./
3) MT JACD STAT CUR STAT RESORT DEAL/C FLT STE,TA IA/RT/DO LOC
4) -- --- ---- ---- ---- ------- ------ ------------------ ---
5) A 215 0320 FAX JLT L-BIFL MORBID,SH T/O
6) L-5
7)
8) L-20/X 9060/01-45/ FD,N,T,Z,P,
9)
10)
10) L-27/Y 6785/01-45/& T/O
11) PAP
12)
13)
14) G 512 0110 JKT ZYP L-BIFL LOPEZ,JE T/O
15) * * * NO DATA AVAILABLE * * *
16) ROLL-UP FOR MORE INFORMATION PAGE 1 OF 10 >KT
////////////////////////////////////////////////////////////////////////
Note: The preview shows that the message has been stripped of spaces.
In the message "L-" starts from around col 40. (as in line 5)
Can it be done? Any help would be appreciated.
Thanks. |
|
Back to top |
|
 |
kirani |
Posted: Thu Jul 15, 2004 10:23 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
If your input is not fixed then how are you suppose to convert it to XML format? Lets say you have 100 different types of reprot that can come on input queue. Do you have mapping rules defined for those 100 reports, like how each one of those report should look in XML format? Is there any report identifier that you can use to identify the type of report you are dealing with?
Once you identify the mapping rules for each type of report, you can then convert it into XML format by writing some ESQL code. But using BLOB data type as input you will end up using SUBSTRING function to extract data from specific positions to create output XML. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 16, 2004 4:26 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I agree with everything kirani has said. What about the downstream application that receives the XML which your message flow generates? It will need to process those XML messages, so it must have some idea of their logical structure. Maybe you could approach the problem like this:
1. Analyse the reports, and see whether you can find a logical structure (or if possible, ask somebody who knows)
2. Construct a logical mode which describes all the various kinds of reports.
3. Add a TDS physical format to your logical model, and set it up to parse the various kinds of reports.
4 Add an XML physical format, and set up it to write out the various kinds of reports. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|