How to invoke WebService with a Custom URI

How to invoke WebService with a Custom URI

book

Article ID: KB0083291

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.x

Description

We have a WebService which endpoint is changing in each environment. Is there a way to define the endpoint you are going to invoke without needing to make changes to Channel Object?

Issue/Introduction

How to invoke WebService with a Custom URI.

Environment

All Supported Platforms

Resolution

While sending out an HTTP event, instead of using the Event.sendEvent() function, use the catalog functions under HTTP. For example, use HTTP.sendRequest() to send the request. The URL for the endpoint is passed by the first parameter of the function.
Object connectionInfo_1 = HTTP.ConnectionInfo.createHTTPConnectionInfo(false);
String requestURL = "http://localhost:9090/Channels/HTTPChannel/setInfo";
Events.returnEmpInfoEvent res = HTTP.sendRequest(requestURL, setempinfoevent, "/Events/returnEmpInfoEvent", 60000, connectionInfo_1);

 

Additional Information

https://docs.tibco.com/pub/businessevents-standard/5.3.0/doc/html/GUID-D2EAC038-EE5E-49AF-9197-4572F68E1035.html 
https://docs.tibco.com/pub/businessevents-standard/5.4.0/doc/functions/Standard/HTTP/sendRequest.html