Topic
  • 7 replies
  • Latest Post - ‏2019-08-19T18:47:17Z by HermannSW
dp-dude
dp-dude
19 Posts

Pinned topic MPGW - how to make a HTTP GET process a request rule?

‏2010-02-22T11:43:25Z |
I have an MPGW with a dynamic backend that must process GET and POST requests. The problem is I cannot set the backend in a request rule when a GET is received - due to "The one way exchange pattern will bypass the execution of the selected request rule" (from the log). Come to think of it, I can't do anything useful with a GET request in MPGW if I can't invoke a request rule - so GET might as well be crippled :(

My question is: is there a way to enable request rule processing in MPGW given a HTTP GET request? I can't find a HTTP handler of MPGW setting to enable it, but perhaps I missed it or there is another workaround?

TIA!
  • swlinn
    swlinn
    1445 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-02-22T14:35:41Z  
    On your FSH, do you have the GET method enabled? Also, GET methods are by their nature, non-XML. If you are not doing a HTTP Convert operation as the first operation of your request rule, then try to enable non-XML processing in the rule (accessible from the processing rule link from the objects menu).

    Regards,
    Steve
  • dp-dude
    dp-dude
    19 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-02-22T16:11:20Z  
    • swlinn
    • ‏2010-02-22T14:35:41Z
    On your FSH, do you have the GET method enabled? Also, GET methods are by their nature, non-XML. If you are not doing a HTTP Convert operation as the first operation of your request rule, then try to enable non-XML processing in the rule (accessible from the processing rule link from the objects menu).

    Regards,
    Steve
    GET was enabled for my MPGW, however it was set to SOAP-processing requests, so my rule was still bypassed. However enabling non-xml content for the target rule via the "Objects" menu fixed it - thanks Steve!

    NB: I really can't fathom why so many options have to be "hidden" under the Objects menu like this. Why can't I just edit this property from the MPGW Policy/Rule editing page like everything else? Oh well, I guess the moral of the story is to always go digging under the Object menue when trying to find the hidden option...
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-03-08T16:50:23Z  
    I got into same problem. I enabled GET with my FSH and set Non-xml processing with my request rule. MPG has strted picking up my request rule but I have a transform action in my requset rule which is used to dynamically select a routing URL.

    I'm getting error while executing the transform action.

    local://Request.xsl:7: type of the right-hand side of / operator must be a nodeset, but isn't

    How can I execute a xsl when request rule is running for http get request.

    Regards,
    Rohit
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-03-08T17:35:33Z  
    I got into same problem. I enabled GET with my FSH and set Non-xml processing with my request rule. MPG has strted picking up my request rule but I have a transform action in my requset rule which is used to dynamically select a routing URL.

    I'm getting error while executing the transform action.

    local://Request.xsl:7: type of the right-hand side of / operator must be a nodeset, but isn't

    How can I execute a xsl when request rule is running for http get request.

    Regards,
    Rohit
    Most likely because the transform that runs Request.xsl has the Input Context set to INPUT, and it fails when it tries to parse the data as XML.

    You can:
    1) Set the Input Context of transform action that runs Request.xsl to NULL. This assumes that you have no need to look inside the payload when making your routing decision.
    OR
    2) Use a match rule to pickup HTTP GET calls and set up the processing on the rule appropriately. Use HTTP-Convert as the first action on the rule, which'll convert the call to XML, and then use the transform action that runs Request.xsl.

    Regards,
    --Arif
  • BillHines
    BillHines
    76 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-03-09T20:10:26Z  
    • dp-dude
    • ‏2010-02-22T16:11:20Z
    GET was enabled for my MPGW, however it was set to SOAP-processing requests, so my rule was still bypassed. However enabling non-xml content for the target rule via the "Objects" menu fixed it - thanks Steve!

    NB: I really can't fathom why so many options have to be "hidden" under the Objects menu like this. Why can't I just edit this property from the MPGW Policy/Rule editing page like everything else? Oh well, I guess the moral of the story is to always go digging under the Object menue when trying to find the hidden option...
    Also in 3.8.0 there is a new switch on the main page of the service to allow processing of empty request bodies, which is helpful for REST scenarios where that is the norm.

    Bill Hines
    Author of IBM WebSphere DataPower SOA Appliance Handbook published by IBM Press (with John Rasmussen, Jaime Ryan, Simon Kapadia, Jim Brennan)
    http://www.amazon.com/gp/product/0137148194?ie=UTF8&tag=dph-20&link_code=as3&camp=211189&creative=373489&creativeASIN=0137148194
  • maduriDP
    maduriDP
    39 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2010-10-25T15:34:34Z  
    I am still facing the same problem -

    1. Checked Non-XML processing to On
    2. Turned "Process empty messages" to On
    3. My Match Action is of Type URL with /a/b/c
    4. However when I send a request with URI /a/b/d , I expect the request to not go through , However the request succeeds.
    5. This is what I get in the system logs -

    "xmlfirewall (XMLFW-CFS-DPHealth): The one way exchange pattern will bypass the execution of the selected rule
    xmlfirewall (XMLFW-CFS-DPHealth): No match from processing policy 'XMLFW-CFS-DPHealth' - default rule selected.
    Matching (XMLFW-CFS-DPHealth): No match: Received URL [/a/b/d/] does not match rule '/a/b/c'

    We are clueless... Any help would be greatly appreciated!!!

    Thanks,
    Maduri
  • HermannSW
    HermannSW
    8691 Posts

    Re: MPGW - how to make a HTTP GET process a request rule?

    ‏2019-08-19T18:47:17Z  
    • maduriDP
    • ‏2010-10-25T15:34:34Z
    I am still facing the same problem -

    1. Checked Non-XML processing to On
    2. Turned "Process empty messages" to On
    3. My Match Action is of Type URL with /a/b/c
    4. However when I send a request with URI /a/b/d , I expect the request to not go through , However the request succeeds.
    5. This is what I get in the system logs -

    "xmlfirewall (XMLFW-CFS-DPHealth): The one way exchange pattern will bypass the execution of the selected rule
    xmlfirewall (XMLFW-CFS-DPHealth): No match from processing policy 'XMLFW-CFS-DPHealth' - default rule selected.
    Matching (XMLFW-CFS-DPHealth): No match: Received URL [/a/b/d/] does not match rule '/a/b/c'

    We are clueless... Any help would be greatly appreciated!!!

    Thanks,
    Maduri

    Please don't hijack ancient threads.

    Create a new thread and provide more information.

    Locking this thread now.