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 on INPUT Node

Post new topic  Reply to topic
 Validation on INPUT Node « View previous topic :: View next topic » 
Author Message
RaviKrG
PostPosted: Tue Sep 16, 2008 11:33 pm    Post subject: Validation on INPUT Node Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Hi there I have a flow something like MQINPUT NODE --> COMPUTE NODE ----> MQOUTPUT in WMB V6.0 on Windows

I have a message set defined for this flow and I have also kept the properties for validation on the input node as :
VALIDATE : COntent and Value
Failure and Action : Local Error Log
General Message Option : Parse Timing Complete

When I pass any type of data, it reaches the ouput node

my message def file is defined as

<xsd:element name="personaldetails" type="personaldetailsCT"/>

<xsd:complexType name="personaldetailsCT">
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="lastname" type="xsd:string"/>
<xsd:element name="age" type="xsd:decimal"/>
<xsd:element name="address" type="addressCT"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="addressCT">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>


Can somebody tell what I am missing to get my data validated in this.

Thanks in Advance.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Sep 16, 2008 11:55 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

have you set the parse timing to immediate ??? default value is on demand
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
RaviKrG
PostPosted: Wed Sep 17, 2008 12:04 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

I have set the parse timing to COMPLETE, but I have some correction now in the above problem

1) When I pass a string value instead of decimal(like age tag) then it throws an error and the message is backed out ---- there is no problem

2) But when I pass numerical values or alphanumerical values instead of STRING type then no error is thrown and the message is passed to output node. ----- this should not happen

3) When the age tag is missing then it throws warning but the message is passed to output queue --- this should not happen
Back to top
View user's profile Send private message
RaviKrG
PostPosted: Wed Sep 17, 2008 12:07 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Also when I change the sequence of the input message tags the message is transferred to the output queue and also error occurs in the event log --this should not happen .

The message should be transferred to backout queue / failure queue.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 17, 2008 12:10 am    Post subject: Reply with quote

Grand High Poobah

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

What domain are you using? I believe that in 6.0 you have to use a message set and the MRM domain to be able to truely validate. The XMLNS(C) domains will only validate that you have a valid XML document.

Version 6.1 will let you validate against xsds in the XMLNS(C) domains
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RaviKrG
PostPosted: Wed Sep 17, 2008 12:17 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Thanks for reply saper . For your query What domain are you using? , I have used MRM and ya you are right its V6.0
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Sep 17, 2008 2:01 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
1) When I pass a string value instead of decimal(like age tag) then it throws an error and the message is backed out ---- there is no problem
Explanation: The MRM parser does not regard a data conversion error as a 'validation error'. So it throws a parser exception which causes you message to be backed out. See 3) for what happens to 'validation' errors

Quote:
2) But when I pass numerical values or alphanumerical values instead of STRING type then no error is thrown and the message is passed to output node. ----- this should not happen
Explanation: A string is allowed to contain digits - check the XML Schema specification for xs:string. If you want to disallow digits in your string, create a new simple type which is a restriction of xsd:string and add some Value Constraints ( schema facets ) to it.
Quote:
3) When the age tag is missing then it throws warning but the message is passed to output queue --- this should not happen
The MRM parser defines this as a 'validation error'. You have asked for validation errors to be logged, but not thrown.
If you want the message to be backed out, you should set 'Failure Action' to 'Exception'.
Back to top
View user's profile Send private message
RaviKrG
PostPosted: Wed Sep 17, 2008 2:09 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Thanks Kim , I am making changes and trying to apply the things here . I am changing my xml schema now and will apply what you have said in your reply

Thanks for your help
Back to top
View user's profile Send private message
RaviKrG
PostPosted: Wed Sep 17, 2008 2:55 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Thanks Kim Now this is working fine and the properties on the MQINPUT Node I have is :

Validation --> Validate --> Content and Value
Validation --> Failure Action --> Exception
General Message Options --> Parse Timing --> Immediate

Thanks for all your valuable inputs
Back to top
View user's profile Send private message
Vijay_d
PostPosted: Tue Sep 30, 2008 1:47 am    Post subject: Reply with quote

Apprentice

Joined: 09 Oct 2006
Posts: 26
Location: LONDON

Ravi,

Can u post ur new XSD which u created.

Or let me know how did u do value contraint to xs:string type element.


Thanks
Back to top
View user's profile Send private message
RaviKrG
PostPosted: Tue Sep 30, 2008 10:03 am    Post subject: Reply with quote

Master

Joined: 07 Sep 2008
Posts: 240

Hello Vijay, Well I did the proper validation only for the element firstname and not for all. And the way I did was :

<xsd:element name="firstname">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-zA-Z]*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

For more you can refer to w3schools (xsd schema).

Thanks
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 on INPUT Node
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.