Author |
Message
|
RaviKrG |
Posted: Tue Sep 16, 2008 11:33 pm Post subject: Validation on INPUT Node |
|
|
 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 |
|
 |
AkankshA |
Posted: Tue Sep 16, 2008 11:55 pm Post subject: |
|
|
 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 |
|
 |
RaviKrG |
Posted: Wed Sep 17, 2008 12:04 am Post subject: |
|
|
 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 |
|
 |
RaviKrG |
Posted: Wed Sep 17, 2008 12:07 am Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Wed Sep 17, 2008 12:10 am Post subject: |
|
|
 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 |
|
 |
RaviKrG |
Posted: Wed Sep 17, 2008 12:17 am Post subject: |
|
|
 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 |
|
 |
kimbert |
Posted: Wed Sep 17, 2008 2:01 am Post subject: |
|
|
 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 |
|
 |
RaviKrG |
Posted: Wed Sep 17, 2008 2:09 am Post subject: |
|
|
 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 |
|
 |
RaviKrG |
Posted: Wed Sep 17, 2008 2:55 am Post subject: |
|
|
 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 |
|
 |
Vijay_d |
Posted: Tue Sep 30, 2008 1:47 am Post subject: |
|
|
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 |
|
 |
RaviKrG |
Posted: Tue Sep 30, 2008 10:03 am Post subject: |
|
|
 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 |
|
 |
|