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 Error on MQInput node

Post new topic  Reply to topic
 Validation Error on MQInput node « View previous topic :: View next topic » 
Author Message
$ureshWMB
PostPosted: Wed Aug 27, 2014 3:49 am    Post subject: Validation Error on MQInput node Reply with quote

Apprentice

Joined: 06 Apr 2014
Posts: 36

Hi All,
I have a message flow MqInput--->Compute------>MqOutput.
On MqInput i am validating the input payload against xsd.

Code:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Person">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" type="xs:string" name="Name" />
        <xs:element minOccurs="0" type="xs:byte" name="Age" />
        <xs:element minOccurs="0" type="xs:string" name="Address" />
        <xs:element minOccurs="1" type="xs:int" name="Pin" />
        <xs:element minOccurs="0" type="xs:string" name="Designation" />
        <xs:element minOccurs="1" type="xs:string" name="Company" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

The elements Pin and Company are the mandatory.

While sending the request i am missing one all the mandatory element.

Code:
<Person>
  <Name>xxxxx</Name>
  <Age>xxxxxxxx</Age>
  <Address>xxxxx</Address>
  <Designation>xxxxxxxxxx</Designation>
  <Company>xxxxxxxx</Company>
</Person>


Here i have missed <Pin> element.


And The properties on MQInput node like.

Validation--->Validate(Content and Value)
Failure Action(Exception)

Parser Options---->Parse Timing(Complete)


When i send an invalid request its validating it properly.

On failure terminal of MQInputNode..

XMLNSC
Person
Name:CHARACTER:xxxx
Age:INTEGER:xxxxxxx
Address:CHARACTER:xxxx

Here i wanted to get the actual input message which i have sent.

Code:
<Person>
<Name>xxxxx</Name>
<Age>xxxxxxxx</Age>
<Address>xxxxx</Address>
<Designation>xxxxxxxxxx</Designation>
<Company>xxxxxxxx</Company>
</Person>


How to get this.

if i have my like

MQInput--->RCD--->Compute---->OutPut

I am performing validations on RCD and connected Mqinput node catch terminal to my Error Handler flow here i am able to get the actual input message but i dont want to use RCD and need to capture the actual input message.



Thanks In Advance...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Aug 27, 2014 4:10 am    Post subject: Reply with quote

Jedi Council

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

You have to delay the parse and/or validation i.e. no do it in the MQInput Node.
Then you can copy the Message tree to the Environment which will give you access to is in your failure processing.

If you read the message from the queue as a blob you can catch the cases where the XML is invalid and not just something like a field missing.
Then after copying it, you can parse/validate the message.
.
_________________
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
$ureshWMB
PostPosted: Wed Aug 27, 2014 4:23 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2014
Posts: 36

smdavies99 wrote:
You have to delay the parse and/or validation i.e. no do it in the MQInput Node.
Then you can copy the Message tree to the Environment which will give you access to is in your failure processing.

If you read the message from the queue as a blob you can catch the cases where the XML is invalid and not just something like a field missing.
Then after copying it, you can parse/validate the message.
.



Thanks for your response.

So there is no way to do this on MQinput node..
As i said if i have the following nodes in flow.

MQInput--->RCD--->Compute--->Output


Then i am doing validation on RCD node in this i am able to get the input message but i wanted to do the same without having RCD node.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 27, 2014 4:25 am    Post subject: Reply with quote

Grand High Poobah

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

smdavies99 wrote:
You have to delay the parse and/or validation i.e. no do it in the MQInput Node.
Then you can copy the Message tree to the Environment which will give you access to is in your failure processing.

If you read the message from the queue as a blob you can catch the cases where the XML is invalid and not just something like a field missing.
Then after copying it, you can parse/validate the message.
.


That's doing double the work.
Link the failure terminal of the MQInput node to the RCD node and change the domain to BLOB. This should always give you the input message, unless you have a bad MQ message (message with a bad RFH for instance). The exception list should at this point already have information on what went wrong...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
$ureshWMB
PostPosted: Wed Aug 27, 2014 6:04 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2014
Posts: 36

fjb_saper wrote:
smdavies99 wrote:
You have to delay the parse and/or validation i.e. no do it in the MQInput Node.
Then you can copy the Message tree to the Environment which will give you access to is in your failure processing.

If you read the message from the queue as a blob you can catch the cases where the XML is invalid and not just something like a field missing.
Then after copying it, you can parse/validate the message.
.


That's doing double the work.
Link the failure terminal of the MQInput node to the RCD node and change the domain to BLOB. This should always give you the input message, unless you have a bad MQ message (message with a bad RFH for instance). The exception list should at this point already have information on what went wrong...

Have fun


I am able to get in the input until it reaches to missing mandatory element <Pin> .

When i send an invalid request its validating it properly.

On failure terminal of MQInputNode..

XMLNSC
Person
Name:CHARACTER:xxxx
Age:INTEGER:xxxxxxx
Address:CHARACTER:xxxx

i want to get these two elemets too...
<Designation>xxxxxxxxxx</Designation>
<Company>xxxxxxxx</Company>

Here i wanted to get the actual input message which i have sent.

<Person>
<Name>xxxxx</Name>
<Age>xxxxxxxx</Age>
<Address>xxxxx</Address>
<Designation>xxxxxxxxxx</Designation>
<Company>xxxxxxxx</Company>
</Person>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 27, 2014 6:08 am    Post subject: Reply with quote

Grand High Poobah

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

So did you make your first node out the MQInput failure node an RCD node changing the domain to BLOB? That should have the full unparsed input message. And you want to leave it as BLOB. Any parsing you do might result in you having either no data (not an XML message) or partial data only (as you saw)...
Of course you could also use record and replay, or event emitting on rollback...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
$ureshWMB
PostPosted: Wed Aug 27, 2014 10:10 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2014
Posts: 36

fjb_saper wrote:
So did you make your first node out the MQInput failure node an RCD node changing the domain to BLOB? That should have the full unparsed input message. And you want to leave it as BLOB. Any parsing you do might result in you having either no data (not an XML message) or partial data only (as you saw)...
Of course you could also use record and replay, or event emitting on rollback...

Have fun


Hi

My flow has below nodes.

MQInput--->Compute---->MqOutput


I am performing validation on MQInput node against xsd.
When the input message is unable to match the xsd its raising an exception up to now every thing is fine.

On failure terminal of MQInput node i am unable to see the exact input message which i have sent and i getting the message up to the parsing exception.

e.g i have 5 elements in my request message and parsing exception comes on 3rd element. Here i am able to see 2 elements which have parsed only. I wanted to get 5 elements which i have sent without using the RCD node(MQInput--->Compute---->MqOutput).
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Aug 28, 2014 4:13 am    Post subject: Reply with quote

Grand High Poobah

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

So which part of my above advice did you not understand?
What do you see in the BLOB? (Cast it to char if you need to read it)...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
$ureshWMB
PostPosted: Mon Sep 01, 2014 5:22 am    Post subject: Reply with quote

Apprentice

Joined: 06 Apr 2014
Posts: 36

fjb_saper wrote:
So which part of my above advice did you not understand?
What do you see in the BLOB? (Cast it to char if you need to read it)...



Thank you fjb_saper. its worked.

Thanks every one...
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 Error on MQInput 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.