We’re receiving an error from apigeetool deployproxy … when deploying a proxy containing a ServiceCallout policy with a LoadBalancer element. Copying the policy directly or uploading the proxy using a zip file works as expected.
Policy snippet:
<ServiceCallout async="false" continueOnError="false" enabled="true" name="SC.GetAccessToken">
<DisplayName>SC.GetAccessToken</DisplayName>
<Properties/>
<Request clearPayload="true">
<Set>
<Headers>
<Header name="Accept">application/json</Header>
</Headers>
<Payload contentType="application/json" variableSuffix="#" variablePrefix="%">
{
"Username": "%request.formparam.username#",
"Password": "%request.formparam.password#"
}
</Payload>
<Verb>POST</Verb>
</Set>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</Request>
<Response>apigee.servicecallout.GetAccessTokenResponse</Response>
<HTTPTargetConnection>
<Properties>
<Property name="success.codes">2XX</Property>
</Properties>
<LoadBalancer>
<Server name="loadbalancerserver1"/>
</LoadBalancer>
<Path>/api/v1/admin/token</Path>
</HTTPTargetConnection>
</ServiceCallout>
and this is the error response:
Command failed: apigeetool deployproxy -V -u %APIGEE_USR% -p %APIGEE_PWD% -o %ORG% -e dev -n auth -d .
Error: Error uploading policy SC.GetAccessToken.xml: {
"code" : "beans.OtherValidationError",
"message" : "Unexpected Validation Error null",
"contexts" : [ ]
}
Error: Error uploading policy SC.GetAccessToken.xml: {
"code" : "beans.OtherValidationError",
"message" : "Unexpected Validation Error null",
"contexts" : [ ]
}
at Request._callback (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\lib\commands\deployproxy.js:397:18)
at Request.self.callback (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (C:\Users\michael.mcdowell\AppData\Roaming\npm\node_modules\apigeetool\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
at emitNone (events.js:110:20)
Any ideas as to how we might fix this much appreciated.
Michael McD.