Managing Consumable Mappings
When a Wsdl contract is imported into a Consumable Web Service the service parameters are mapped to parameter positions of the Web Service subroutine to call. When importing the Wsdl contract of the Web Service shown as example in the Managing Provided Mappings help page this will lead to the mapping as shown in the picture below.
What is important to realize that Web Services based on functions (result := fun(inp1, inp2, ...) ) will import into the Consumable Web Service as subroutines ( sub(inp1, inp2, ... , result) ) where result is a parameter with a argument by reference in order to be able to output the result value. For the Provided Web Service of the example shown in the Managing Provided Mappings help page the routine to use the resulting Consumable Web Service could look like the example shown below.
begin_routine
cws_cel_to_fahr.basichttpbinding_ictof.rou_celtofahr(cels, fahrht)
end_routine
Wsdl that still have a result on position 0 will change to the new style of output parameters after a reload of the Wsdl. This necessitates the change of the call code to match the new positions of the parameters. |
Example with multiple outputs
When given a Provided Web Service which converts temperature in degrees Fahrenheit to degrees Celsius and Kelvin the mappings resulting from the Wsdl import could look like the mappings shown in the picture below.
The actual order of the arguments in the call to the webservice should reflect the order of the positions of the mappings, as shown in red in the code example below.
begin_routine
cws_fahrcelkel.basichttpbinding_ifahrcelkel.rou_fahrtocelkel(fahrht, cels, kelv)
end_routine