The qie.callRESTWebService function includes multiple parameters. The first parameter passed is the WS connection name. The second parameter passed is the URL. To call another endpoint, just pass a different URL to that call. Keep in mind, the SSL configuration (selected certificates, client authentication etc) configured in the WS connection will be used with the URL passed in. So, if the SSL configuration is different for the over ridden URL, a different WS connection is required.
Sample Code:
//Code created by the mapping function using what is on the ws connection
var parameterMap = qie.newParameterMap();
var urlTemplate = qie.evaluateTemplate("https://immun.dhec.sc.gov/HL7Service/MessageService.svc");
var content = qie.evaluateTemplate("<root></root>", false);
var value = qie.callRESTWebService(
"iis test1",
urlTemplate,
"POST",
content,
"application/xml",
parameterMap,
60000);
// Call a different url overriding what is on the ws connection
var parameterMap = qie.newParameterMap();
var urlTemplate = qie.evaluateTemplate("https://some.web.service:8300/XMLService");
var content = qie.evaluateTemplate("<root></root>", false);
var value = qie.callRESTWebService(
"iis test1",
urlTemplate,
"POST",
content,
"application/xml",
parameterMap,
60000);
Using the standard mappings to setup your code:
You can also build the code like what you see above using the mapping function dialog. You setup your webservice like you see below and then copy the code in the script window or click on the "Customize Script" checkbox.