I have an API proxy and I’m extracting values from the original request to do target path replacement. Trace view is showing conflicting values.
Here is my target endpoint
<HTTPTargetConnection>
<Properties/>
<URL>http://data.tmsapi.com/v1.1/theatres/{data-theatreId}/movies</URL>
</HTTPTargetConnection>
In the preflow for that endpoint, I have three policies, logically, extractTheaterId, assignTheaterId, assignApiKey. Neither of my assigns create a new message.
Here is the extract policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="extractTheatreIdFromMoviesPath">
<DisplayName>extractTheatreIdFromMoviesPath</DisplayName>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<Source clearPayload="false">request</Source>
<URIPath>
<Pattern ignoreCase="true">/{data-theatreId}/movies</Pattern>
</URIPath>
</ExtractVariables>
Here is the assignTheaterId
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="addTheatreIdMovies">
<DisplayName>addTheatreIdMovies</DisplayName>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<AssignTo createNew="true" transport="http" type="request"/>
<AssignVariable>
<Name>target.url</Name>
<Value>http://data.tmsapi.com/v1.1/theatres/{data-theatreId}/movies</Value>
</AssignVariable>
</AssignMessage>
And here is the assignApiKey (obfuscated)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="addGraceApiKey">
<DisplayName>addGraceApiKey</DisplayName>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
<Add>
<QueryParams>
<QueryParam name="api_key"> -OBFUSCATED- </QueryParam>
</QueryParams>
</Add>
</AssignMessage>
(I know it’s not right to store it this way but this is just for POC at the moment
When you look at the trace views that I’ve attached, it appears in the header to have done the replacement for theaterId, but if you see the target.url and the “show curl”, in both those places it is still my variable name. You will also see in the trace view headers, you see the api key, but in the curl there is no api key.
This is very confusing and I hope I’m doing something wrong or somebody can recommend a different strategy.



