Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

service call out timeout error

i am new to apigee need help for following.

in service call out policy i have following code

<ServiceCallout name='ServiceCalloutGetMockResponse'>
        <DisplayName>ServiceCallout.GetMockResponse</DisplayName>
        <Request variable="myrequest">
<Set>
<Headers>
<Header name="apikey">keyvalue</Header>
</Headers>
<Verb>POST</Verb>
</Set> </Request> <Response>mockresponse</Response> <HTTPTargetConnection> <URL>https://mocktarget.apigee.net/v1</URL> </HTTPTargetConnection> </ServiceCallout>

but in trace i able to see like servicecallout.requesturi: /v1 only. is it correct?

and getting 500 timeout error.

can any one help me how to resolve this issue .

and one more doubt in AssignVariable <Template> is used what is the purpose of it and from where value is being pulled to that variable.

Thanks in Advance.

0 1 136
1 REPLY 1


@skarthi wrote:

can any one help me how to resolve this issue .


Some of us might be able to try, but we won't be able to help very much if all you show us is the ServiceCallout policy configuration.

One thing I can point out, your URL for the HTTPTargetConnection is https://mocktarget.apigee.net/v1. As far as I am aware, there is no API or resource that responds at that URL. If you examine https://mocktarget.apigee.net/help you will see the options for this particular endpoint. There are none that use the /v1 basepath. Therefore, inserting https://mocktarget.apigee.net/v1 into your ServiceCallout policy is probably wrong.

In my tests, when I send a request like GET https://mocktarget.apigee.net/v1 , I get a 404 response, not a 500.  

So here is what I expect is happening: 

  • you have built an API proxy
  • at some point you inserted a ServiceCallout, pointing to https://mocktarget.apigee.net/v1
  • When you execute it, the mocktarget endpoint responds with a 404
  • The Apigee API proxy handles that status by putting the proxy execution into "fault" state
  • This cases a 500 to be returned to the original client

The way to resolve this is to not use /v1 in the path.  Use something else.  Like /echo

BTW, are you sure you need a ServiceCallout?  Normally connection to an upstream system would be done via the API TargetEndpoint.  Double check that you want to use a ServiceCallout.  If you're not sure, then you probably want a TargetEndpoint. 


@skarthi wrote:

t in AssignVariable <Template> is used what is the purpose of it and from where value is being pulled to that variable.


Have you read the documentation for this configuration element?  What part of the description was not clear?