setEndpointForWebService

setEndpointForWebService(className:  String;
                         methodName: String;
                         message:    String): String;

Reimplement the setEndpointForWebService method of the Application class in a user schema to redirect an incoming Web service request to another Web service application. The response is provided by the Web service application receiving the redirected request, which could be running in a separate JADE system.

The Web service application that receives Web service requests from consumers initially redirects them to other Web service applications is acting as a gateway Web service.

The parameters for the setEndpointForWebService method are listed in the following table.

Parameter Specifies the …
className Name of the JadeWebServiceProvider class, which is in the schema of the Web service provider application to which the Web service request is redirected
methodName Name of the Web service method
message Incoming SOAP message

The following example shows a reimplementation of the setEndpointForWebService method in the schema of the gateway Web service.

vars
    //  GatewayConsumer is a JadeWebServiceConsumer class in current schema
    ws: GatewayConsumer;
begin
    create ws;
    if className = "CustomerService" then
        // CustomerWebService is a JadeWebServiceProvider class in the
        // schema to which the request will be redirected
        ws.setEndpointURL("http://host1/jade/jadehttp.dll?WebApp1&"
                          & "serviceName=CustomerWebService");
    elseif className = "ProductService" then
        // ProductWebService is a JadeWebServiceProvider class in the
        // schema to which the request will be redirected
        ws.setEndpointURL("http://host2/jade/jadehttp.dll?WebApp2&"
                          & "serviceName=ProductWebService");
    endif;
    // The JadeWebServiceConsumer::invoke method redirects the request
    return ws.invoke(message);
epilog
    delete ws;
end;

For more details, see "Creating a Web Service Gateway", in Chapter 11 in your JADE Developer’s Reference.