Sending an Asynchronous Request (Not Secure)

To send requests to an HTTP server asynchronously, use this function.

Signature

String sendAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String successCallbackRuleFunctionURL, String errorCallbackRuleFunctionURL, String methodType, Object httpConnectionInfo)

Description

Sends a request to the server specified by the url parameter. When TIBCO BusinessEvents receives a response, the callback function is called.

Returns a correlation ID, which is either passed as input, or is generated from the server if the parameter is null. This ID enables you to correlate a request with its response.

You can disable the cookies using the disableCookies() function. To ensure that the entire message along with the response header and the request body is sent at once, use disableExpectContinueHeader().

For handling timeout case, you can set the java property com.tibco.be.http.client.socketTimeout with the required timeout period.

Parameters

Name Type Description
url
String
The URL for the server that will receive this request.
requestEvent
SimpleEvent
The event to serialize and send to the server.
correlationID
String
An optional ID to correlate the request and the response.

If not specified, the ID is generated by the server.

successCallbackRuleFunctionURL
String
The fully-qualified path of a rule function to be invoked for success case. This rule function is called when a successful response is received. The response event would contain the correlation ID.

The rule function must have correlation ID, RequestEvent, and ResponseEvent as parameters.

errorCallbackRuleFunctionURL
String
The fully-qualified path of a rule function to be called in case of an error. This rule function is called when the response received indicates an error. The response event would contain the correlation ID.

The parameter can be null.

The rule function must have correlation ID, RequestEvent, and ResponseEvent as parameters.

methodType
String
The HTTP method type. Valid values are: GET or POST.
httpConnectionInfo
Object
HTTP Connection Info object.

Returns

Type Description
String
A correlation ID