I'm unable to use a variable for the field HTTPTargetConnection.URL for the hostname. If I set it to https://{SOME_VARIABLE}/. I get an error when using the proxy {"fault":{"faultstring":"The Service is temporarily unavailable","detail":{"errorcode":"messaging.adaptors.http.flow.ServiceUnavailable"}}}
If there is validation that needs to be done then it should happen on save, or deploy. Otherwise the proxy is in an inconsistent state. Regardless, I feel there should be a variable allowed here since we have a number of target endpoints (other than the default) which use the same host.
Solved! Go to Solution.
I think its not supported, you can use variables for paths, but not for the host name. I think this helps the runtime to setup connection pools to targets.
If there is a need for multiple target servers with same host [assuming across proxies], then you might want to use Targetservers.
I think its not supported, you can use variables for paths, but not for the host name. I think this helps the runtime to setup connection pools to targets.
If there is a need for multiple target servers with same host [assuming across proxies], then you might want to use Targetservers.
@Praveen Dhandapani, I do not believe its supported. In addition to what @mukundha@apigee.com mentioned, another option is to set the target.uri property to the hostname you desire in a JavaScript policy.
If a JavaScript policy allows you to change the value, it makes sense that you should be allowed to change it from XML as well. Much more convenient
Would using a Route Rule not allow you to achieve the same thing?
Hi Praveen,
Use javascript policy and set target.url variable.
e.g.
var baashostname = context.getVariable("baashostname");
var baasorgname = context.getVariable("baasorgname");
var baasappname = context.getVariable("baasappname");
var targeturl = "https://"+baashostname+"/"+baasorgname+"/"+baasappname+"/termsandconditions";
context.setVariable("target.url", targeturl);