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:
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???
HermannSW 2700006U547038 Posts
Re: Results Action Help2013-03-15T10:05:26ZThis is the accepted answer. This is the accepted answer.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 $
<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: //22.214.171.124:81</url> <url>http: //126.96.36.199: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/>