Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-03-15T17:42:28Z by gwing
gwing
gwing
10 Posts
ACCEPTED ANSWER

Pinned topic Results Action Help

‏2013-03-14T17:46:07Z |
This has been discussed on the forum quite a bit and I believe I've read most of them! I think I'm missing something pretty basic. I want to sent an incoming request to a backend service. If the backend service isn't available, try another one. This is on a MPGW.

I used a set variable action to set a context variable (var://context/message/msgout). This is on multiple lines for ease of reading:

<results mode="first-available">
<url>http://127.0.0.1:1996</url>
<url>http://127.0.0.1:1997</url>
</results>

I have set the Results-Action to use this variable as the destination. The logs show:

Mar 14 10:33:20 xb60mgmt TESTmultisteperror mpgw(DanTestMPGW): trans(3486321)requesthttp://192.168.90.24: request MultipleDestinations_rule_0 #3 results: 'generated from message_out sent to var://context/message/msgout using HTTP method POST' failed: Error sending to <results mode="first-available"><url>http://127.0.0.1:1997</url><url>http://127.0.0.1:1996</url></results>.
Mar 14 10:33:21 xb60mgmt TESTmpgwerror mpgw(DanTestMPGW): trans(3486321)errorhttp://192.168.90.24: Invalid URL

What am I missing???

Thanks,
Dan
Updated on 2013-03-15T17:42:28Z at 2013-03-15T17:42:28Z by gwing
  • HermannSW
    HermannSW
    4512 Posts
    ACCEPTED ANSWER

    Re: Results Action Help

    ‏2013-03-15T10:05:26Z  in response to gwing
    I did get the same error, because I copied the <results>...</results> into the value part of set-variable action.
    If you look into Probe you will see that DataPower treats that as a String and not as a nodeset.

    Then I used below stylesheet in a NULL-Transform-NULL action and it worked.
    After hitting timeout for 1st url, the response from 2nd url is returned.
    I had to set "Process Messages Whose Body Is Empty" to "on" in advanced tab of XML FW in order to process GET request:
    
    $ time curl --data-binary 
    "<x/>" http:
    //dp3-l3:2082 <html> This is <b>dp4-l3.boeblingen.de.ibm.com</b>. </html>   real        3m9.015s user   0m0.001s sys    0m0.014s $
    


    Stylesheet:
    
    <xsl:stylesheet version=
    "1.0" xmlns:xsl=
    "http://www.w3.org/1999/XSL/Transform" xmlns:dp=
    "http://www.datapower.com/extensions" extension-element-prefixes=
    "dp" > <xsl:variable name=
    "results">Process Messages Whose Body Is Empty <results mode=
    "first-available"> <url>http:
    //9.152.4.11:81</url> <url>http:
    //9.152.4.11:80</url> </results> </xsl:variable> <xsl:template match=
    "/"> <dp:set-variable name=
    "'var://context/results/remote-multi'" value=
    "$results" /> </xsl:template> </xsl:stylesheet>
    


     
    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>
  • gwing
    gwing
    10 Posts
    ACCEPTED ANSWER

    Re: Results Action Help

    ‏2013-03-15T17:42:28Z  in response to gwing
    Thanks! The stylesheet did the trick!

    Dan