Using the Imported Web Service Consumer

In the following examples, there are two Web services with the methods for running them synchronously called getClient and getAgent.

When you import the WSDL, you can optionally generate methods to run Web services asynchronously. If you select this option, additional methods are generated with Begin and End appended to the name of the synchronous method; that is, getClientBegin, getClientEnd, getAgentBegin, and getAgentEnd.

The following is an example of the getClient method generated in the ErewhonInvestmentsService class.

getClient(inputParameters:GetClient) : GetClientResponse webService, updating;
/*  This code was generated by Jade and cannot be modified
    Runtime Version: 99.0.00
*/
vars
    any: Any;
begin
    _callAsync := false;
    _methodName := method.name;
    addParameter("inputParameters", inputParameters);
    any := sendRequest("getClient");
    if any = null then
        return null;
    else
        return any.GetClientResponse;
    endif;
end;

The addHttpHeader method of the JadeWebServiceConsumer class enables you to add, change, or remove HTTP headers. The getHttpHeader method of the JadeWebServiceConsumer class enables you to examine the value of a user-defined HTTP header.

The getHttpHeaderClient method of the JadeWebServiceConsumer class enables you to examine the value of a client HTTP header sent with a Web service request. The getHttpHeaderServer method of the JadeWebServiceConsumer class enables you to examine the value of a server HTTP header sent with a Web service response.

In the following sections, code examples show how to run the Web service methods synchronously and asynchronously.