Externalizing the targer server as environment variable is not working

Not applicable

Hello,

I have developed one API service in Apigee Edge called PostalCode for example. I used the "VehcileCode" proxy as a TargetServer for one more Proxy API.

If i configure postalCode service as a Target Server like below in a new Proxy API. This is working fine.

<HTTPTargetConnection>

<URL>http://manidemo-test.apigee.net/postalcode</URL> </HTTPTargetConnection>

I tried to externalize by configuring the PostalCode URL as a Environment variable in Apigee and

Named it as "Server_Postal_Code"

HOST : http://manidemo-test.apigee.net

PORT: 80

But its not working when i tried it like this:

<HTTPTargetConnection>

<LoadBalancer> <Server name="Server_Postal_Code"/>

</LoadBalancer>

<Path>/postalcode</Path>

</HTTPTargetConnection>

Getting error as : Trace below. It went into error flow on reaching the targetflow

5071-targeterror.jpg

Can someone help me ?

Solved Solved
0 6 365
1 ACCEPTED SOLUTION

Hi @manikandanj

You do not need to add the "http://" in the Target Server configuration. Just put the hostname there - allianzdemo-test.apigee.net.

Hope the endpoint you are connecting as TargetServer is a valid API endpoint.

Let me know if that did the trick

View solution in original post

6 REPLIES 6

Not applicable

Make sure your target server definition (variable) and use on the proxy are correct and name matches. See example below

TargetServer definition:

5072-screen-shot-2017-06-10-at-103747-am.png

To use the TargetServer you add the code on this section under "default" (assuming you don't have conditional flows):

5073-screen-shot-2017-06-10-at-103635-am.png

Code will look like this:

5074-screen-shot-2017-06-10-at-103659-am.png

Name on the Server entry listed above must match the variable definition created.

On reaching the target server endpoint flow itself the error occurs like "The service is temporarily unavailable"

5075-capture.jpg

The target end point config is :

5076-targetendpoint.jpg

The Environment is:

5077-environment.jpg

If your target another API deployed on Edge?

Do you have an API deployed to http://allianzdemo-test.apigee.net?

I don't think your problem is the TargetServer definition or use but the API/end-point you are trying to call.

What do you see in the

Request sent to target server?

Hi @manikandanj

You do not need to add the "http://" in the Target Server configuration. Just put the hostname there - allianzdemo-test.apigee.net.

Hope the endpoint you are connecting as TargetServer is a valid API endpoint.

Let me know if that did the trick

Thanks @Sai Saran Vaidyanathan. This seems to be the problem. I removed the http://