I have designed a DataPower flow to allow centralized processing of HTTP Post/Get requests. My configuration is working, but I'd like some explanation for an inconsistency that I see.
I am currently testing this configuration with a loopback of a standard HTTP post with a standard query in the body of the message.
In the MPG created for this configuration, I have the request message type as NON-XML and a route action that rewrites the URL from a stylesheet.
When a request is processed, I can use the probe to at least view the Context variables, Headers, etc. if I have the response set up as NON-XML, I get an error due to the body of the request containing a post query.
My question basically is why doe the incoming message process as a NON-XML, but errors out on a response of NON-XML?
When I use pass-through on the response it, as excepted, works fine. I can live with this configuration, because I don't see any need to do any processing on a REST response.
I just need confirmation that it is alright to use NON-XML for a request and pass-though for a response.
Is there a better way to modify URLs on a pass-through message type?
Re: MPG Request/Response message types2013-03-20T16:06:34ZThis is the accepted answer. This is the accepted answer.
- kenhygh 120000PD1B
Keep in mind that I am doing a loopback, so the message is a standard HTTP Post message with standard post query in body.
The error message I get back is a parser error chocking on the first character in the body which is a 'T'.
My ultimate curiosity is why the same error isn't encountered on the request going through the MPG?
Doesn't appear that the reques is parsed which would make sense based on the definition of what a NON-XML message type is.
So why on the response is an attempt made to parse?
Re: MPG Request/Response message types2013-03-20T16:58:07ZThis is the accepted answer. This is the accepted answer.
- jaluecht 2700051C5T
Sorry, didn't even look at your name on your original post :-)
If it's a "loopback", then the response should be identical to the request, no? So if you have 'non-xml' for the request, you'll need that - or something less stringent like 'passthru' for the response.
Are you doing any processing on the response? If you have a transform action on the response using INPUT, DataPower will try to parse the response to feed it to your stylesheet. That could be the cause of the error.
There's nothing in DataPower to require the request and response to be of the same 'type' (e.g. SOAP|XML|non-XML|binary|...)
Re: MPG Request/Response message types2013-03-20T19:10:20ZThis is the accepted answer. This is the accepted answer.
- kenhygh 120000PD1B
There isn'y any reason for me to use other than pass-through on the response. But you know me, I'm a nuts and bolts guy...
I'm really more curious as to why is the message is the same content - headers are different - just sending the message through an XML firewall for loopback ....
Actually that might be it - did sending the message through an XML Firewall du something to the message that the MPG response process wants to parse it?