Client / Writing a GWS client application |
To access a remote Web service, you must get the WSDL information from the service provider. Sample services can be found through UDDI registries or on other sites such as XMethods (http://www.xmethods.net).
fglwsdl -o Example2Client http://localhost:8090/MyCalculator?WSDL
The following definitions were generated in the globals file, Example2Client.inc:
DEFINE Add RECORD ATTRIBUTE( XMLName="Add", XMLNamespace="http://tempuri.org/webservices" ) a INTEGER ATTRIBUTE( XMLName="a", XMLNamespace="" ), b INTEGER ATTRIBUTE( XMLName="b", XMLNamespace="" ) END RECORD DEFINE AddResponse RECORD ATTRIBUTE( XMLName="AddResponse", XMLNamespace="http://tempuri.org/webservices" ) r INTEGER ATTRIBUTE(XMLName="r",XMLNamespace="" ) END RECORD
Since BDL functions cannot have complex structures as parameters, the data types are defined as global or modular variables.
This globals file contains the prototype of two functions for the Add operation.
The Add function uses input and output parameters, and returns the status and result. This function can only be used if the input and output parameters are not complex structures such as arrays or records. Using this function, developers do not access the global records directly.
The Add_g function can be used with the global input and output records. Before calling this function, you must set the values in the variables of the global input record.
Operation: Add # # FUNCTION: Add_g() # RETURNING: soapStatus # INPUT: GLOBAL Add # OUTPUT: GLOBAL AddResponse # # FUNCTION: Add(p_a, p_b) # RETURNING: soapStatus ,p_r
See fglwsdl and Client stub and handlers for more details regarding the fglwsdl tool, its output and the generated functions.