<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ServiceCallout async="false" continueOnError="false" enabled="true" name="AddCustomerRSS"> <DisplayName>AddCustomerRSS</DisplayName> <Properties/> <Request clearPayload="true" variable="addCustomerRSS"> <Set> <Headers> <Header name="Content-Type">application/json</Header> </Headers> <Verb>POST</Verb> <Payload contentType="application/json"> {"PortId":"SEARSCA", "Folder":"Receive","Filename":"test.xml","Content":"base64blob"} </Payload> </Set> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> </Request> <Response>calloutResponse</Response> <HTTPTargetConnection> <Properties/> <URL>HIDDEN_FOR_SECURITY</URL> </HTTPTargetConnection> </ServiceCallout>
I have a really strange error occurring in a service callout policy. The code is above.
{ "fault": { "faultstring": "Unresolved variable : \"PortId\"", "detail": { "errorcode": "messaging.runtime.UnresolvedVariable" } } }
Solved! Go to Solution.
@aleks1 This is a bug in Apigee Edge. For now you can do this:
<Payload contentType="application/json"> \{"PortId":"SEARSCA", "Folder":"Receive","Filename":"test.xml","Content":"base64blob"} </Payload>
This is escape the curly brace and not try and resolve the PortId as a variable. There is a fix that we are going to deploy in few days. For now just go with this workaround, you might have to change this later to remove the "\" escapte character.