Trace Tool truncates Response Message Body

Hi, it would appear that the trace tool is truncating the response body after a certain length. We have tried downloading a trace and the effect is the same.

Here is a response body that is truncated copied directly from the downloaded xml:

{"RESULT":{"DIM":10000,"SIZE":25,"ITEMS":[{"CUR":"AUD","TEXTE":"Australian Dollar","CURSYM":"$"},{"CUR":"CAD","TEXTE":"Canadian Dollar","CURSYM":"$"},{"CUR":"CNY","TEXTE":"Chinese yuan","CURSYM":"Y"},{"CUR":"EUR","TEXTE":"EURO","CURSYM":"null"},{"CUR":"GBP","TEXTE":"British Pound","CURSYM":"#"},{"CUR":"MXN","TEXTE":"Mexican Pesos ( New)","CURSYM":"$"},{"CUR":"MXP","TEXTE":"Mexican Pesos","CURSYM":"$"},{"CUR":"PLN","TEXTE":"Polish Zloty (new)","CURSYM":"null"},{"CUR":"RUR","TEXTE":"Russian ruble".....

You can see the cut off occuring at '...'.

We are using the tool to evaluate xslt translations that we do in multiple steps. It is extremely hard to see if it is working without tearing them out one by one and evaluating the response in the browser.

How can I see the full response message body using the trace tool?

Thanks in advance.

Solved Solved
0 3 1,194
1 ACCEPTED SOLUTION

Unfortunately the Trace tool will always truncate the message body in this way.

The way to sort of workaround it while debugging is to assign a variable with the value contained within the response.content variable. Other variables don't get truncated 😐

<AssignMessage name='AM-Diagnostics'>
  <AssignVariable>
    <Name>diagvar</Name>
    <Ref>response.content</Ref>
  </AssignVariable>
</AssignMessage> 

View solution in original post

3 REPLIES 3

Unfortunately the Trace tool will always truncate the message body in this way.

The way to sort of workaround it while debugging is to assign a variable with the value contained within the response.content variable. Other variables don't get truncated 😐

<AssignMessage name='AM-Diagnostics'>
  <AssignVariable>
    <Name>diagvar</Name>
    <Ref>response.content</Ref>
  </AssignVariable>
</AssignMessage> 

Hello,

The request body is truncated when tracing a API proxy. is there another solution from the one suggested above i.e to create variable?

By creating a policy to Assign message, we have to re-deploy the API proxy and that is not feasible in a production environment. Can someone please suggest alternatives? Thanks.

Hi Madhu

Yes, the situation is somewhat unfortunate. 

The easiest way to see the request body in the Trace UI, is what I suggested above. Add that diagnostics policy.  And yes, you need to update the deployment.  I understand that your view  is that re-deploying in production is "not feasible in production", and ....  I gently suggest that you re-examine that constraint. If the need to view and examine the request payload is high, then you should be able to redeploy in prod.  (In general it's a bad sign if you can't update your prod deployments with agility)

There is another way you could get some visibility into that payload: change the data path. For example, you could insert an additional proxy, between the client and Apigee. Or between Apigee and the target. Let's call it a "passthrough proxy".  The client calls the passthrough, which calls the original API proxy. 

That would allow you to insert a policy as I described into the "passthrough proxy", and get that visibility.

To make this happen you would need to update the client to point to a different endpoint.  Or re-configure your DNS CNAMEs.

That sounds as disruptive as redeploying in prod.  Maybe moreso. 

Sorry I don't have a magic solution for you.