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 DataPower » MPG - How to bypass Schema Validation step when HTTP 404?

Post new topic  Reply to topic
 MPG - How to bypass Schema Validation step when HTTP 404? « View previous topic :: View next topic » 
Author Message
simon.starkie
PostPosted: Thu Oct 31, 2013 10:57 am    Post subject: MPG - How to bypass Schema Validation step when HTTP 404? Reply with quote

Disciple

Joined: 24 Mar 2002
Posts: 180

I have developed a Datapower MPG for a restFul service.

The project requirements specify Schema Validation.
For both the Requests and the Responses.
So for that, we implemented a Validate steps.
In both the Request and the Response rules of the Datapower MPG .

The schema is retrieved from WSRR using the bsrURI on the Validate URL.
We did this instead of having a LOCAL schema file in DP to make the code more agile.

Everything works perfectly when the back end service provider is running.
A "good" request passes the Validate step in the Request rule and is sent to the back end.
A "bad" request, for example a request with an empty element that is required to contain a value, returns a schema validation error as expected.

But the problem is, when the back end service provider is down (HTTP 404) the Validate in the Response rule fails.

Obviously, this is because the XML response is not valid wrt the schema.
Instead, the Response looks like this:
Code:
<request>
<url>/service/cd/diag_therapy/pharm/op_pharm_svc/MUePrescribingService/v1>/restsvc/mu/MUePrescribingService/inst1/rx/newRx/restsvc/mu/MUePrescribingService/inst2/rx/newRx</url>
<base-url>/service/cd/diag_therapy/pharm/op_pharm_svc/MUePrescribingService/v1>/restsvc/mu/MUePrescribingService/inst1/rx/newRx/restsvc/mu/MUePrescribingService/inst2/rx/newRx</base-url>
<args src="url" />
<args src="body">
<arg name="<H1>SRVE0255E: A WebGroup/Virtual Host to handle /service/cd/diag_therapy/pharm/op_pharm_svc/MUePrescribingService/v1" />
<arg name="gt;/restsvc/mu/MUePrescribingService/inst1/rx/newRx/restsvc/mu/MUePrescribingService/inst2/rx/newRx has not been defined.</H1><BR><H3>SRVE0255E: A WebGroup/Virtual Host to handle wzadwa22.wcdc.kp.org:10283 has not been defined.</H3><BR><I>IBM WebSphere Application Server</I>" />
</args>
</request>


One possibility would be to make the validation step in the Response Rule conditional.
Then, when error occurs and an unexpected XML Response, like the above,
is returned to the MPG, the validation step could be avoided.
And thereby avoid setting a Schema Validation error.
And masking/clouding the real problem described in the XML response.

Here's a picture of the Response Rule:
[img][/img]
Back to top
View user's profile Send private message
vishBroker
PostPosted: Wed Jan 29, 2014 2:30 pm    Post subject: Reply with quote

Centurion

Joined: 08 Dec 2010
Posts: 135

It looks like you have turned on 'process backend errors'.

If you turn it off - then the error rule would be called.
Then you can do specific xformation in error rule. ( Here you may not want to use validate action).

If you need process backend errors - then you need to handle the errors in xslt before it reaches the validate action.
Use XSLT to convert the error (fault message) into acceptable schema.
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 DataPower » MPG - How to bypass Schema Validation step when HTTP 404?
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.