This section explains how HTTP functions are used to send secure and non-secure HTTP requests to other servers, and work with responses received.See HTTP Channel Advanced Configuration Settings for details about setting up TIBCO BusinessEvents as a secure server.HTTPS requires use of an SSL certificate. It creates a keystore file and password for the specified type of SSL certificate (keystore).
Object getPostData(SimpleEvent event)
Request event sent on the HTTP destination. Must not be null.
As explained in Task A, Add an HTTP Connection, ensure that certificates from trusted certificate authorities are stored in the project, using an Identity resource in the TIBCO Shared Resources folder. Alternatively use the BE_GLOBAL_TRUSTED_CA_STORE global variable to store a location of the certificates outside of the project.Object loadTrustedCertificates(String trustedCertsFolder, String passwordToSet)HTTPS requires use of an SSL certificate. This function loads a trusted certificate (that is, creates and returns a keystore object) from the trusted certificates folder.
The project path to the folder containing the certificates.If trusted certificates are stored outside the project, use the following construct in the function:System.getGlobalVariableAsString("BE_GLOBAL_TRUSTED_CA_STORE")
Event sendRequest (String url, SimpleEvent requestEvent, String responseEventURI, long timeoutMillis)
The URL for the endpoint that will receive this request. The fully-qualified path of an event. This event is created when the response is received. If the value is -1, the server waits forever.
String sendAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationId, String callbackRuleFunctionURL, String methodType)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.
The URL for the server that will receive this request. An optional ID to correlate the request and the response. callbackRuleFunctionURL The fully-qualified path of a rule function. This rule function is called when the response is received. The response event would contain the correlation ID.The rule function must have correlation ID, RequestEvent, and ResponseEvent as parameters.
String sendSecureAsynchronousRequest(String url, SimpleEvent requestEvent, String correlationID, String callbackRuleFunctionURL, String methodType, Object clientIdKeystore, String clientIdPassword, Object trustedCertsKeystore, String trustedCertsPassword boolean verifyHostName)This function is the same as the sendAsynchronousRequest() function, with the addition of the SSL-related parameters, shown below.All of the parameters for sendAsynchronousRequest() plus the following:
Keystore Object for trusted certificates. Password for the trusted certificates keystore. Flag for checking if a host name matches the names stored in the server’s certificates.
Event sendSecureRequest(String url, SimpleEvent requestEvent, String responseEventURI, Object clientIdKeystore, String clientIdPassword, Object trustedCertsKeystore, String trustedCertsPassword, boolean verifyHostName,long timeoutMillis)This function is the same as the sendSecureAsynchronousRequest() function, except that the requests are synchronous. The parameters are shown below.
The URL for the server that will receive this request. SimpleEvent The fully-qualified path of an event. This event is created when the response is received. Keystore Object for trusted certificates. Password for the trusted certificates keystore. Flag for checking if a host name matches the names stored in the server’s certificates. The timeout interval for the operation.If the value is -1, the server waits forever.
Copyright © TIBCO Software Inc. All Rights Reserved.