Topic
5 replies Latest Post - ‏2013-03-20T20:21:34Z by kenhygh
jaluecht
jaluecht
29 Posts
ACCEPTED ANSWER

Pinned topic MPG Request/Response message types

‏2013-03-20T14:24:17Z |
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?
Updated on 2013-03-20T20:21:34Z at 2013-03-20T20:21:34Z by kenhygh
  • kenhygh
    kenhygh
    1427 Posts
    ACCEPTED ANSWER

    Re: MPG Request/Response message types

    ‏2013-03-20T15:11:01Z  in response to jaluecht
    What error do you receive?
    • jaluecht
      jaluecht
      29 Posts
      ACCEPTED ANSWER

      Re: MPG Request/Response message types

      ‏2013-03-20T16:06:34Z  in response to kenhygh
      Ken - so nice to hear from you!

      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?
      • kenhygh
        kenhygh
        1427 Posts
        ACCEPTED ANSWER

        Re: MPG Request/Response message types

        ‏2013-03-20T16:58:07Z  in response to jaluecht
        Jeff,
        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|...)

        Ken
        • jaluecht
          jaluecht
          29 Posts
          ACCEPTED ANSWER

          Re: MPG Request/Response message types

          ‏2013-03-20T19:10:20Z  in response to kenhygh
          Ken:

          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?
          • kenhygh
            kenhygh
            1427 Posts
            ACCEPTED ANSWER

            Re: MPG Request/Response message types

            ‏2013-03-20T20:21:34Z  in response to jaluecht
            Jeff,
            Are you certain it's erroring in the MPG and not in the XMLFW?

            k