Author |
Message
|
wmb_novice123 |
Posted: Tue Jan 29, 2013 9:26 pm Post subject: Reading a message using XMLNSC |
|
|
Newbie
Joined: 29 Jan 2013 Posts: 3
|
Hi,
I have a scenario where in I have to read the XML msg and a partuicular field in the msg. I have multiple messages coming in like credit, debit, payment status, payment reversal with namespaces like ct, dd,ps, pr resp.
The below code shows :
CREATE FIRSTCHILD OF Environment.Variable DOMAIN ('XMLNSC') ;
DECLARE reqRef REFERENCE TO Environment.Variable.XMLNSC ;
CREATE field reqRef.Message ;
SET reqRef.Message = InputRoot.XMLNSC.Message ;
But I see that reqRef.Message is not populated at all. |
|
Back to top |
|
 |
wmb_novice123 |
Posted: Tue Jan 29, 2013 9:27 pm Post subject: Reading a message using XMLNSC |
|
|
Newbie
Joined: 29 Jan 2013 Posts: 3
|
Sent it by mistake.
The incoming Message looks like this
Code: |
<Message xmlns="urn:bcsis"
xmlns:ps="urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03"
xmlns:head="urn:iso:std:iso:20022:tech:xsd:head.001.001.01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:bcsis.Payment.Status.01.xsd
urn:iso:std:iso:20022:tech:xsd:head.001.001.01 head.001.001.01.xsd
urn:iso:std:iso:20022:tech:xsd:pacs.002.001.03 pacs.002.001.03.xsd">
<AppHdr><head:Fr><head:FIId><head:FinInstnId><head:ClrSysMmbId>
<head:MmbId>MBBESGS0XXX</head:MmbId>
</head:ClrSysMmbId></head:FinInstnId></head:FIId></head:Fr>
<head:To><head:FIId><head:FinInstnId><head:ClrSysMmbId>
<head:MmbId>SACHSGS0XXX</head:MmbId>
</head:ClrSysMmbId></head:FinInstnId></head:FIId></head:To>
<head:BizMsgIdr>B20130129MBBESGS0XXXHAA3529985</head:BizMsgIdr>
<head:MsgDefIdr>pacs.002.001.03</head:MsgDefIdr>
<head:CreDt>2013-01-29T18:21:37Z</head:CreDt>
<head:CpyDplct>DUPL</head:CpyDplct></AppHdr><PaymentStatus>...</PaymentStatus> |
Where am I going wrong
Thanks |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jan 29, 2013 11:21 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
What does a TraceNode inserted right before the compute Node with the output pattern set to ${Root}
show?
How are you reading the message in the first place? Did you set the input node to read the message as XMLNSC rather than the default 'blob' type.
Trace Nodes and UserTrace are really good tools you know. It is worth getting used to using them. (like some other posters here,I don't use the debugger) _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
wmb_novice123 |
Posted: Wed Jan 30, 2013 5:49 pm Post subject: Reading a message using XMLNSC |
|
|
Newbie
Joined: 29 Jan 2013 Posts: 3
|
Hi,
Sorry for posting the trace as a new thread.
Now am able to read the XML after I put the trace node. Thanks for the suggestion.
Now the requirement is I need to check what is coming in the input XML i.e if the XML has the credit, debit, payment status etc.
I have to make a check like
If incoming msg is credit then
populate the output msg
else if the incoming msg is debit then
...
How can I achieve this in an optimized way? Using If else is time consuming I believe.
Thanks |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jan 30, 2013 6:35 pm Post subject: Re: Reading a message using XMLNSC |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
wmb_novice123 wrote: |
How can I achieve this in an optimized way? Using If else is time consuming I believe. |
Where you get the Message Type info in your input message? Why and how do you thing If-Else is time consuming? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 30, 2013 6:36 pm Post subject: Re: Reading a message using XMLNSC |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wmb_novice123 wrote: |
Using If else is time consuming I believe. |
What leads you to believe that? Quote sources.
Clearly there are any number of ways to write inefficient ESQL in the same way you can write inefficient Java, C, COBOL or Perl.
But if you want "optimized" ESQL, eliminating conditional logic isn't the first thing I'd look at. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 31, 2013 4:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is very very limited value in creating a single message flow that processes all possible message types.
If you put all of your eggs in one basket, and that basket halts and catches fire, then all of the chickens in the hen house will be standing around your desk yelling at you to fix things because the company is losing money.
So you need to make a *design* *decision* about how to organize your incoming messages into groups that make sense, and process each group with the correct number of message flows.
Otherwise, you can't remotely make decisions about the performance of a system until you have tested that performance.
But, hey, if you just want to avoid using an IF statement, you can use a Route node instead. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jan 31, 2013 5:35 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
mqjeff wrote: |
There is very very limited value in creating a single message flow that processes all possible message types. |
Me thinks this is another new hire at the big bank in North Carolina. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 31, 2013 5:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Clearly if the OP's problem is not that messages need to be distinguished between credit and debit, but between account open, address change, signer change, status change, etc, etc, etc then yes an if .... elseif...elseif structure will consume development and maintenence time even if it doesn
t consume machine resource.
I echo the comments of my most worthy associate regarding the wisdom of having all of this logic in a single flow.
And if that's the scenario, WMB provides a number of tools for routing messages to different components based on content which the OP may find more "optimal" than ESQL. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 31, 2013 5:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
lancelotlinc wrote: |
mqjeff wrote: |
There is very very limited value in creating a single message flow that processes all possible message types. |
Me thinks this is another new hire at the big bank in North Carolina. |
I have not noticed that this sort of poor design is limited to big banks in North Carolina. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jan 31, 2013 6:05 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
This design concept of processing many message types with a single flow is like the thinking is to create an application container-container.
There must be some glory in designing containers rather than actual applications that live in containers. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jan 31, 2013 9:27 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
Me thinks this is another new hire at the big bank in North Carolina. |
I have not noticed that this sort of poor design is limited to big banks in North Carolina.[/quote]
How about using Message Broker to process SNMP Traps when the customer has Tivoli instaled and working _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 31, 2013 10:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99 wrote: |
mqjeff wrote: |
lancelotlinc wrote: |
Me thinks this is another new hire at the big bank in North Carolina. |
I have not noticed that this sort of poor design is limited to big banks in North Carolina. |
How about using Message Broker to process SNMP Traps when the customer has Tivoli instaled and working |
I haven't seen that anywhere. That doesn't mean that it's not more pervasive than at a single point. But I've not seen it.
And if I did see it, I would advise against it... |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jan 31, 2013 9:00 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
And if I did see it, I would advise against it... |
I did exactly that but the contract says... everything must go through broker
sigh. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
adubya |
Posted: Fri Feb 01, 2013 6:32 am Post subject: |
|
|
Partisan
Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK
|
I forsee the InfoCentre pages on NAMESPACEs in your future.... |
|
Back to top |
|
 |
|