invokeAsyncWithVerb(inputMessage: String; verbIn: String): JadeMethodContext updating;
The invokeAsyncWithVerb method of the JadeWebServiceConsumer class sends the SOAP-formatted message specified in the inputMessage parameter, using the verb specified in the verbIn parameter, to the Web service and returns an instance of the
This method does the same as the JadeWebServiceConsumer class invokeAsync method, except that the verb specified in the verbIn parameter is used (for example, "GET" or "PUT") instead of "POST". Calling the invokeAsync method is the same as calling the invokeAsyncWithVerb method with "POST" specified in the verbIn parameter.
The workerApp property must be set to the name of an asynchronous worker application, which must execute the
The JadeMethodContext instance can be used as input to the waitForMethods method on the Process class, to enable your code to wait for the completion of the asynchronous execution of the Web service and obtain the results.
Reimplement the invokeAsyncWithVerb method in the following situations when you also need to specify the verb that is used.
If you do not want to use the JADE Web service communications framework, which currently supports only HTTP (for example, if you prefer to use SMTP rather than the HTTP protocol), so that you can use your own communication handlers.
If you want to dynamically connect to a Web service (that is, without using or importing a WSDL file). If you have a JadeWebServiceConsumer subclass called DoItMyself, the method in the following example illustrates calling the Amazon Web service dynamically.
vars doItMyself : DoItMyself; inputMsg : String; context : JadeMethodContext; outputMsg : String; begin create doItMyself transient; doItMyself.workerApp := "AsyncWorkerApp"; doItMyself.setEndpointURL('http://soap.amazon.com/onca/soap2'); inputMsg := ""; //soap request here context := doItMyself.invokeAsyncWithVerb(inputMsg, verb); // context now contains the JadeMethodContext that will send // the Web service request in a worker application and receive // the response from the Web service provider process.waitForMethods(context); // wait for asynchronous Web service message to complete // could do other processing while waiting for the completion outputMsg := context.getReturnValue.String; // outputMsg now contains the response from the Web service write outputMsg; epilog delete doItMyself; end;
In this case, you are dealing directly with SOAP messages.
You can use the invokeAsyncWithVerb method, for example, to allow users to access a REST service using the HTTP GET verb.