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 » VALIDATION for Junk characters ??

Post new topic  Reply to topic
 VALIDATION for Junk characters ?? « View previous topic :: View next topic » 
Author Message
my_mqmb
PostPosted: Tue Jan 24, 2012 1:58 am    Post subject: VALIDATION for Junk characters ?? Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

Dear All MB experts ,

I have a requirement to validate/filter all my incoming XML and throw exceptions in case any tag has JUNK characters ..

What could be the simplest and the most efficient way?
i have to implement this in almost 100 existing services

Best brains please stand up ...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jan 24, 2012 2:13 am    Post subject: Re: VALIDATION for Junk characters ?? Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

my_mqmb wrote:

I have a requirement to validate/filter all my incoming XML and throw exceptions in case any tag has JUNK characters ..


would you care to define by what you mean JUNK Characters?

The first question you have to ask yourself is
Do I want to modify the code or can I do it in the MessageSet?

If it is the latter then you could apply an Enumeration pattern to the fields in the XSD/MessageSet. Some fields may well have character that are valid but would be regarded as JUNK in others.

This is a nice explanation as to what I mean.

Ok, it is a Pain in the Posterior to have to go through all the XSD's to apply them individually. BUT you can define what is valid/invalid for exch field if that is the granularity you desire.
[/b]
_________________
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
View user's profile Send private message
my_mqmb
PostPosted: Tue Jan 24, 2012 2:28 am    Post subject: Re: VALIDATION for Junk characters ?? Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

smdavies99 wrote:
my_mqmb wrote:

I have a requirement to validate/filter all my incoming XML and throw exceptions in case any tag has JUNK characters ..


would you care to define by what you mean JUNK Characters?

The first question you have to ask yourself is
Do I want to modify the code or can I do it in the MessageSet?

If it is the latter then you could apply an Enumeration pattern to the fields in the XSD/MessageSet. Some fields may well have character that are valid but would be regarded as JUNK in others.

This is a nice explanation as to what I mean.

Ok, it is a Pain in the Posterior to have to go through all the XSD's to apply them individually. BUT you can define what is valid/invalid for exch field if that is the granularity you desire.
[/b]


thnx mate for yr reply .. what i mean by junk characters is that sometimes due to inter-system language encoding [arabic mostly] issues we get junk instead of a valid character set..

like for example :

<Cmpny_Nm>شرÙ&#x83;Ù&#x87; اسÙ&#x88;اÙ&#x82; عبداÙ&#x84;Ù&#x84;Ù&#x87; اÙ&#x84;عثÙ&#x8a;Ù&#x85; ا</Cmpny_Nm>


now what might be the easiest way in ESQL for throw an exception outright ?

i guess message sets would be a pain , but a code replacement much easier ..

what say ??
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Tue Jan 24, 2012 2:32 am    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

also to add , we have multi language , english and arabic sometimes ...
so patter matching can also be complex in a msg set

but i do use a common flow to handle the incoming messages for all the flows ..
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jan 24, 2012 3:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
what i mean by junk characters is that sometimes due to inter-system language encoding [arabic mostly] issues we get junk instead of a valid character set..
So the sender fails to set the CCSID correctly, right?
Quote:
also to add , we have multi language , english and arabic sometimes ...
so patter matching can also be complex in a msg set
It might be enough to find one or two elements/attributes in the input that are only allowed to take a restricted set of values. Validate those fields using a set of enumerations that includes both the English and Arabic values, and you will be able to reject documents which have been parsed using the wrong encoding.
The other fields can be declared as xs:string if you really don't care about their values, although it's best practice to create a schema that accurately describes the entire input document.
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 » VALIDATION for Junk characters ??
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.