Service Callout Truncated Results

Not applicable

We have service callouts that seems to always get truncated at approx 500 characters. In the trace we also see a odd behavior, the action on the Policy is "PAUSE".

Obviously with the results truncated we cannot run a convert XML->JSON policy as the result is not valid. THe backend system is working fine and sending all the content. Weve substituted a javascript policy for the time being but this will not work in our prod environment as we need to use the apigee target servers for load balancing.

Solved Solved
2 3 1,138
1 ACCEPTED SOLUTION

HI @Ryan Manzer

Welcome to the community !

The o/p is truncated only on the trace UI. The actual o/p will include the full response that is coming from the service callout's backend. Assign it to a variable using Response in your Service Callout and you can reference that as a variable in other policies like Extract Variables by passing the variable as Source.

Let me know if you have any questions.

Have attached a quick proxy for reference. Hope it helps. In this quick proxy, I use the service callout response as a variable. Extract what I want from it, in this case, the entire payload and use the Assign Message policy to setup the response.

testingservicecallout-rev2-2016-05-06.zip

View solution in original post

3 REPLIES 3

HI @Ryan Manzer

Welcome to the community !

The o/p is truncated only on the trace UI. The actual o/p will include the full response that is coming from the service callout's backend. Assign it to a variable using Response in your Service Callout and you can reference that as a variable in other policies like Extract Variables by passing the variable as Source.

Let me know if you have any questions.

Have attached a quick proxy for reference. Hope it helps. In this quick proxy, I use the service callout response as a variable. Extract what I want from it, in this case, the entire payload and use the Assign Message policy to setup the response.

testingservicecallout-rev2-2016-05-06.zip

Right you are... we were referencing it as "serviceCalloutResponse" and not "serviceCalloutResponse.content"

Thanks

Ryan

Former Community Member
Not applicable

Is this happening just on the trace tool or you have actually tested the response returned from the service callout? One way is to print the size of the response object. You can have a simple javascript policy (right after the service callout policy) with a print statement like this:

print("Response size is: " + calloutResponse.content.length);

You can see the length printed in the output when you select the javascript policy in the trace tool.