Service Call Out give no response when sending data to another api

I am posting data by postman into api proxy.

I am extracting values by extract policy ,I am assigning the values to a client value by assign policy then i am using javascript policy to convert suppose speed is higher than 50 then I output high or low.

Now i want to forward this json response to another api maybe http://httpbin.org/anything or anything apigee has for me.I want to see the data in the 2nd api.

I am uploading the proxy for your reference.

I am using service call out policy.Do i have to add any other policy after this ?

I am uploading my proxy also.I am uploading my trace also.Service Response Call Out response gives me blank.trace1.pngtrace2.png

Please help

0 2 388
2 REPLIES 2

Hi

Thanks for your question.

I think the problem you are experiencing is that when you use ServiceCallout, the remote system is not receiving what you think it should receive.

I think this is because you have not set the VERB in the ServiceClalout request. Your SC is like this:

<ServiceCallout name="ServiceCallout-GeocodingRequest1">
    <DisplayName>Inline request message</DisplayName>
    <Request variable="callAnotherService">
        <Set>
            <Payload contentType="application/json">
              {response.content}
            </Payload>
        </Set>
    </Request>
    <Response>CalloutResponse</Response>
    <Timeout>30000</Timeout>
    <HTTPTargetConnection>
        <URL>https://httpbin.org/anything</URL>
    </HTTPTargetConnection>
</ServiceCallout>

It must be like this:

<ServiceCallout name="ServiceCallout-GeocodingRequest1">
    <DisplayName>Inline request message</DisplayName>
    <Request variable="callAnotherService">
      <Set>
        <Payload contentType="application/json">
              {response.content}
        </Payload>
        <Verb>POST</Verb>        <!-- you need this -->
        <Path>/anything</Path>   <!-- specify the path here -->
      </Set>
    </Request>
    <Response>CalloutResponse</Response>
    <Timeout>30000</Timeout>
    <HTTPTargetConnection>
        <URL>https://httpbin.org</URL> <!-- use the bare url here -->
    </HTTPTargetConnection>
</ServiceCallout>

ps: if the problem is the service callout, and the response from same, why didn't you show screenshots of the trace of the service callout policy? The trace screenshots you attached were not helpful at all. they showed stuff that was completely irrelevant. You need to highlight the policy of interest - the ServiceCallout policy. You gave us screenshots of the javascript policy, but according to your description, that's not the policy that you are having trouble with.

Yes thank you for your response.I understand.I will upload the trace carefully next time ...