Hi Team,
We have a requirement where we get the hostname of the target in the response of a flow call out policy and then set the rest of the path to complete the target URL. Below is the code snippet through which we are trying to achieve the same.
<HTTPTargetConnection>
<URL>https://{target_host}/demo_target</URL>
</HTTPTargetConnection>
{target_host}, this is being set inside an assign message variable of a shared flow (we are calling this shared flow in the Flow call out policy in the target end point request preflow).
However ,the target Url is not getting formed and hence it is throwing us an error. Is there any way to handle this dynamically within the Target Connection.
Solved! Go to Solution.
@A1nisha23 wrote:
<HTTPTargetConnection>
<URL>https://{target_host}/demo_target</URL>
</HTTPTargetConnection>
hmm, I thought that would work. An alternative is to do this:
<HTTPTargetConnection>
<URL>https://this-will-be-replaced-later</URL>
...
</HTTPTargetConnection>
And then in the AssignMessage step (must be attached to the request within the TargetEndpoint), set the variable target.url to the full URL.
<AssignMessage name='AM-whatever'>
... other elements here ...
<AssignVariable>
<Name>target.url</Name>
<Template>https://{target_host}/demo_target</Template>
</AssignVariable>
</AssignMessage>
As far as I know it is not possible.
@A1nisha23 wrote:
<HTTPTargetConnection>
<URL>https://{target_host}/demo_target</URL>
</HTTPTargetConnection>
hmm, I thought that would work. An alternative is to do this:
<HTTPTargetConnection>
<URL>https://this-will-be-replaced-later</URL>
...
</HTTPTargetConnection>
And then in the AssignMessage step (must be attached to the request within the TargetEndpoint), set the variable target.url to the full URL.
<AssignMessage name='AM-whatever'>
... other elements here ...
<AssignVariable>
<Name>target.url</Name>
<Template>https://{target_host}/demo_target</Template>
</AssignVariable>
</AssignMessage>
Hello dchiesa1 thanks for your reply.
We want to reduce our customization and avoid the use of another assign message policy in the code
<HTTPTargetConnection>
<URL>https://{target_host}/demo_target</URL>
</HTTPTargetConnection>
Is there any other settings in Apigee-X which is preventing this or it is not all possible ?
As far as I know it is not possible.