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 » Limit length of field in delimiter based message set parsing

Post new topic  Reply to topic
 Limit length of field in delimiter based message set parsing « View previous topic :: View next topic » 
Author Message
abhyyy
PostPosted: Wed Jan 18, 2012 8:03 pm    Post subject: Limit length of field in delimiter based message set parsing Reply with quote

Voyager

Joined: 29 Sep 2011
Posts: 83

Hi Friends,

I created a Message set in MRM domain for parsing elimited input message (delimeter is '|') and mentioned Lengths for different tags inproperties tab.

Problem : Even if I declare a tag as datatype "String" and set max length in its properties as 50. When I put string of 80 chars for that tag at the input message it still gets through which it shouldn't.

Question : Can we parse a message using a delimeter but still can restrict the length of delimited fields to the length we want. If yes, How? If No, Is their any workaround to solve this problem?

Thanks alot.
_________________
----------------------
NeVeR StOp LeaRnInG.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jan 18, 2012 8:16 pm    Post subject: Re: Limit length of field in delimiter based message set par Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

abhyyy wrote:

Question : Can we parse a message using a delimeter but still can restrict the length of delimited fields to the length we want. If yes, How? If No, Is their any workaround to solve this problem?

Thanks alot.


Is'nt it contradictory? When you have delimiter, then the application which sends you the message should make sure they place the delimiter at the right place, else the message becomes incorrect.
Back to top
View user's profile Send private message Send e-mail
abhyyy
PostPosted: Wed Jan 18, 2012 9:25 pm    Post subject: Reply with quote

Voyager

Joined: 29 Sep 2011
Posts: 83

They are placing it at the right place as of now. I'm trying to validate the input received from them at my end and handle the parsing error if in case they dont.
Is there a way to do that?
_________________
----------------------
NeVeR StOp LeaRnInG.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 18, 2012 9:33 pm    Post subject: Reply with quote

Grand High Poobah

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

abhyyy wrote:
They are placing it at the right place as of now. I'm trying to validate the input received from them at my end and handle the parsing error if in case they don't.
Is there a way to do that?


This is going to be way more difficult than you ever imagined.
You just simply cannot account for all parsing errors individually... and still make sense of the incoming message...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Jan 19, 2012 3:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Even if I declare a tag as datatype "String" and set max length in its properties as 50. When I put string of 80 chars for that tag at the input message it still gets through which it shouldn't.
Yes, it should - sometimes. The length restriction is an XML Schema facet on the simple type of the element. The MRM parser does not check these 'Value Constraints' unless you switch on validation in your message flow.
Quote:
Can we parse a message using a delimeter but still can restrict the length of delimited fields to the length we want. If yes, How?
Yes - set Validation to 'Content and Value' on the input node.

To explain this another way - the default behaviour of the MRM TDS parser is to parse the physical format and check that it is 'well-formed'. This default behaviour is very similar to the default behaviour of an XML parser.
If you switch on validation then the MRM parser behaves like a validating XML parser ( except that it is not parsing XML ). It checks minOccurs and maxOccurs and checks the simple values against any facets ( Value Constraints ) in the xsd.
Back to top
View user's profile Send private message
whydieanut
PostPosted: Wed Apr 04, 2012 12:45 am    Post subject: Reply with quote

Disciple

Joined: 02 Apr 2010
Posts: 186

I couldn't get the input node to validate length restrictions (even by turning validation on).
But a Validate node after the input node did the trick.

Had to use Simple Type Restrictions for the fields though.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 04, 2012 4:56 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I couldn't get the input node to validate length restrictions (even by turning validation on).
You were doing something wrong - trust me on this. There is absolutely no difference at all between the validation performed by a Validate node and the validation performed by an Input node. However...

I suspect that you forgot to change 'Parse Timing' from its default value of 'On Demand'. A lot of people do that. If I'm right then you should remove the Validate node, set 'Parse Timing' to 'Immediate' and change your flow to use validation on the Input node - you don't want spurious complexity in your flow.
Back to top
View user's profile Send private message
whydieanut
PostPosted: Sun Apr 08, 2012 10:27 pm    Post subject: Reply with quote

Disciple

Joined: 02 Apr 2010
Posts: 186

I'll recheck, though I had set all those options.
The only thing that strikes me is that I am using the MRM domain, and I remember reading that the behaviour of the validation (using XSD facets) is slightly different for MRM domain.
Back to top
View user's profile Send private message
whydieanut
PostPosted: Mon Apr 09, 2012 2:48 am    Post subject: Reply with quote

Disciple

Joined: 02 Apr 2010
Posts: 186

My bad

Clearing the bar file did the job...
No need for the Validate node... Thanks Kimbert!
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 » Limit length of field in delimiter based message set parsing
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.