Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks | BW 6x |
Sometimes we may see that when we call any REST service through Invoke REST API activity then it's failing with "503 Service Unavailable" error. But If you call the same REST service through "Send HTTP request" then its working fine with same input parameters.
-----------------------------------------------
<msgCode>TIBCO-BW-PALETTE-REST-2000028</msgCode>
<statusLine>
<httpVersion/>
<statusCode>503</statusCode>
<reasonPhrase>Service Unavailable</reasonPhrase>
</statusLine>
<httpMessage>
---------------------------------------------------
In Send HTTP Request we are sending "host" as "<HostName>". But in REST Invoke we are sending the "host" as "<HostName>:<Port>"(one with port number).
The external REST Server (which we are trying to access using REST Invoke activity) doesn't seem to like the "Port" in the "host" and reject it with 503 error.
If we override the default "host" in REST Invoke with dynamic header then issue would be resolved.
Solution:
In REST Invoke define another dynamic header "host" and specify its value as "<HostName>" (One without port, see attached REST_Invoke_Header.png)