I have a Proxy API with “No Target Endpoint”. When I do a AssignMessage where I set “success” to be returned in response in response flow, I don’t really get that response back in client, even though that policy is being executed as seen in trace. I’m setting the header, payload correctly. I’m doing a AssignMessage with <AssignTo createNew="false"transport="http"type=“response”/>
What am I missing?
if the policy is getting executed, it should have set the payload, your policy should look something like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
<DisplayName>Assign Message 1</DisplayName>
<FaultRules/>
<Properties/>
<Set>
<Headers>
<Header name="test">success</Header>
</Headers>
<Payload type="text/plain">success</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
Do you have anything different? if its still the same, we need to check the proxy configuration, can you post your apiproxy?
Thanks,
@SZHorani , Can you provide more information on what do you mean by no response ?
(any specific error or timeout ) , In addition pls post the curl req/response as that can help understand the issue more better.
Here is the default.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> (fault.name = "ExecutionReturnedFailure") FaultJavaCalloutFailure Carousel content type (proxy.pathsuffix MatchesPath "/carousel") and (request.verb = "POST") ProcessCarousel PushToJCR Hero Banner content type (proxy.pathsuffix MatchesPath "/herobanner") and (request.verb = "POST") ProcessHeroBanner PushToJCR GetKVM QueueRequest /v1/cms/sync default (calloutStatus == "success") BuildSuccessResponse
And here is the BuildSuccessResponse
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> BuildSuccessResponse application/json { "result":{ "status":"success" } } 200 OK true
1 Like
SZHorani , your policy and proxy definition looks good and there is no problem with that .
However , can you make sure (calloutStatus == “success”) is true and as requested yesterday in comment can you explain more on what do you mean by no response ?
(any specific error or timeout ) , In addition pls post the curl req/response as that can help understand the issue more better.
1 Like
Thanks @Maruti Chand and @mukundha@apigee.com for your help.
Request: {“name”:“value”}
Response: {“name”:“value”}
I was expecting what I’m setting in BuildSuccessResponse. calloutStatus is true, I’ve verified this from trace session
ok so it turned out to be a case issue. “Success” vs “success”. Thanks for your help guys!