Author |
Message
|
yshakraj |
Posted: Thu Jul 05, 2012 6:16 am Post subject: Message getting parsed even for invalid data : |
|
|
 Voyager
Joined: 14 Sep 2011 Posts: 91
|
Hi,
I created a message set with message containing two segments,each segment has fields delimited by '|' and has a Group indicator D and T for first and sec segments respectively.for eg. 'Dabc|def|gh||xy|***EOR***'
each segment ends with '***EOR***' as in above eg.
I have 10 fields in the first segment whish must be delimited by 9 '|'s and termintaed by ***EOR***. when i'm trying to parse against invalid data,skipping few '|'s, even then it's parsing.so please help me fix this problem and tell me a way to fail parsing when data skipping required number of '|' is posted. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 05, 2012 6:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
What does the user trace show you? If you believe the message set does not describe the data being received, what does the trace tell you about how the broker parsed the data & resolved this paradox? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
yshakraj |
Posted: Thu Jul 05, 2012 7:08 am Post subject: |
|
|
 Voyager
Joined: 14 Sep 2011 Posts: 91
|
Message Set is not for fixed length data and hence takes into the field.For example,if the data required is abc|def||. but am sending abcdef| then abcdef gets parsed to first field.If one of the field is missing it has to be '||' which tells field value is null.So it's the number of |'s that tell the message has to be parsed or not |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 05, 2012 7:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
yshakraj wrote: |
Message Set is not for fixed length data and hence takes into the field. |
I got the lack of fixed data from the fact you have the fields delimited.
yshakraj wrote: |
For example,if the data required is abc|def||. but am sending abcdef| then abcdef gets parsed to first field.If one of the field is missing it has to be '||' which tells field value is null. |
Exactly my point. If your message set requires 3 fields so "abc|def||' is valid but "abcdef|" is not, what does the user trace say about why the broker is not worried about the last 2 fields being missing in the invalid example?
yshakraj wrote: |
So it's the number of |'s that tell the message has to be parsed or not |
No it isn't. The message will be parsed if it's a string of random hex.
What tell broker the message is correct is likewise not the number of | characters but the number of mandatory fields which are present. In your case these happen to be delimited by | but broker doesn't care.
You have 3 fields in your example. You want all 3 to be present in your message even if one of them is null. You need to describe that in your message set. Trace will tell you what broker thinks the message set is describing, which is clearly different to what you think it's describing. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 05, 2012 7:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Here's another interesting question - how are you telling WMB to reject invalid messages with fields missing? Do you actually use validation or is there a mechanism in your code? Because (for example) if your code only references the 1st field WMB may not notice the others are missing unless you tell it to check. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 05, 2012 2:19 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
please help me fix this problem and tell me a way to fail parsing when data skipping required number of '|' is posted. |
You can achieve what you want like this:
- enable validation in your message flow. You can do that by setting the 'Validation' property to 'Content and Value' on the input node.
- set minOccurs to 1 for all 10 fields in your record
There is another way, although possibly not an option for you. Upgrade to WMB v8 and replace your MRM message set with a DFDL schema. DFDL explicitly supports the concept of required delimiters via the separatorPolicy property. |
|
Back to top |
|
 |
yshakraj |
Posted: Thu Jul 05, 2012 11:12 pm Post subject: |
|
|
 Voyager
Joined: 14 Sep 2011 Posts: 91
|
I tried with data and content validation set on but it's failing to parse data Dabc||ghi|jkl....,
the fields can be null which should be specified by '||' .
how to implement default value as null and also field is mandatory....... |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jul 06, 2012 12:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
yshakraj |
Posted: Sat Jul 07, 2012 12:46 am Post subject: |
|
|
 Voyager
Joined: 14 Sep 2011 Posts: 91
|
kimbert ..thanks alot..it worked... |
|
Back to top |
|
 |
|