Register | Forgot password
All Blogs...
Some notable differences between Europe and the US are measuring units: in Europe we don’t use inches (except for television sets and computer screens), we don’t have gallons, we don’t do miles and we definitely do not use Fahrenheit. As part of baking an apple pie last weekend, I had to preheat the oven to 175 degrees Celsius and I was wondering what amount I need on the Fahrenheit scale, so I decided to connect a form to the public CelsiusToFahrenheit WebService to give me the answer.
| baseurl | http://www.w3schools.com/webservices/tempconvert.asmx |
| method | POST |
| extraheader | Content-Type: application/soap+xml; charset=utf-8 |
| inputXsl | (see below) |
| outputXsl | (see below) |
| sessionkey | GX_temperature |
<xsl:text disable-output-escaping="yes">
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CelsiusToFahrenheit xmlns="http://tempuri.org/">
<Celsius></xsl:text>
<xsl:value-of select="//formpart[@xsltag=\'celsius\']/userentry" />
<xsl:text disable-output-escaping="yes"></Celsius>
</CelsiusToFahrenheit>
</soap12:Body>
</soap12:Envelope>
</xsl:text>
<xsl:value-of xmlns:tempuri="http://tempuri.org/" select="//tempuri:CelsiusToFahrenheitResult" />
The result value is stored in the user session beneath the GX_temperature key. The value will therefore be accessible under the <temperature> element when using a personalization, so in the personalize panel I create an XSLT expression of type “select” with the expression “/root/system/temperature”. As tag name I use “wm-temperature”.
To see it all work, I create a new form model with two steps. The first step has a required text input field with the XSL tag parameter set to “celsius” (which is needed for the inputXsl to find the value of this field). This field has the “Check decimals” validation rule attached, to make sure no garbage is sent to the WebService. The second step also has a text input field, with the presentation set to a read-only variant and the default value set to “”.
Return to all blogs
Mark is software engineer with a special interest in Security and Digital WebTV. Mark writes about daily engineering with GX WebManager
Read all Marks blog entries
Other blog entries: