If multiple service calls are in use, it might be desirable to configure which headers to send per service call or connection. In this way, you can override the value of blueriq.connection.headers
.
Assuming that the headers that you wish to send with a Soap or Rest request are stored in the session, it is possible to indicate headers that are passed to a specific service call or connection. The property prefix matches the property prefix of your service name.
Code Block |
---|
language | text |
---|
title | application.properties for a RestServiceCall |
---|
|
blueriq.connection.Example.http.url = http://example.com/rest/service
blueriq.connection.Example.http.headers = header2,header3
|
Code Block |
---|
language | text |
---|
title | application.properties for a SoapServiceCall |
---|
|
blueriq.connection.SoapExample.soap.url = http://example.com/soap/service
blueriq.connection.SoapExample.soap.headers = header1,header2,header4
|
If the configured headers are available in the session, they will be sent with the HTTP request. If the configured headers are not available, the particular header will not be sent with the request and a warning that looks like this will be printed to the log:
Code Block |
---|
|
The configured header header1 has not been put on the request because it is not available |
If none of the headers specific to a rest service call, soap service call or connection are found in the session, this will be logged as follows:
Code Block |
---|
|
No headers found for connection Example |
It is also possible to receive headers from a calling application, save them and put them on an outgoing http request in an exposed function flow. To use this functionality you need to configure which headers should be saved, and which headers should be put on a request modeled in the function flow. If your exposed function flow calls a rest service called "MyRestService" that you want to put headers on, your configuration should look like this:
Code Block |
---|
title | application.properties for an exposed function flow |
---|
|
blueriq.user.headers=header1,header2,header3,header4
blueriq.connection.MyRestService.http.url=http://example.com/rest/service
blueriq.connection.MyRestService.http.headers=header2,header3 |