Free Web Services - Herong's Tutorial Examples - Version 2.01, by Dr. Herong Yang
Converting Weight from Grams to Pounds
This section provides a tutorial example on converting weight value from grams to pounds.
To validate the converted weight value received in the previous section. Let's try to convert it back in pounds.
Modify "Request 1" to enter "453.6" in the "Weight" element, "Grams" in the "FromUnit" element, and "PoundsAvoir" in the "ToUnit" element, you will get a sample request message of ConvertWeight in SOAP 1.2 to convert 453.6 pounds to grams:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://www.webserviceX.NET/"> <soap:Header/> <soap:Body> <web:ConvertWeight> <web:Weight>453.6</web:Weight> <web:FromUnit>Grams</web:FromUnit> <web:ToUnit>PoundsAvoir</web:ToUnit> </web:ConvertWeight> </soap:Body> </soap:Envelope>
Here is the response message with the converted weight value:
The result matches my expectation.
Last update: 2015.
Table of Contents