Service Callout always send Get method

i want to create a proxy that need to get parameter from other external api, so i use "service callout". but i always get error message :

{"timestamp":"2019-10-25T08:46:05.728+0000","status":405,"error":"Method Not Allowed","message":"Request method 'GET' not supported","path":"/aaclient/address"}

Here is the "service callout" xml :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="PostAddress">
<DisplayName>PostAddress</DisplayName>
<Properties/>
<Request clearPayload="false" variable="myRequest">
<set>
<Headers>
<Header name="Accept">application/json</Header>
</Headers>
<Verb>POST</Verb>
<Payload contentType="application/json">{"message":"my test message"}</Payload>
</set>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</Request>
<Response>calloutResponse</Response>
<HTTPTargetConnection>
<Properties/>
<URL>https://dummy.id/aaclient/address</URL>
</HTTPTargetConnection>
</ServiceCallout>

Why "Service Callout" always send "Get" method.even though i has set the verb to "POST".

Solved Solved
0 2 319
1 ACCEPTED SOLUTION

The problem is you're using <set></set> instead of <Set></Set>

View solution in original post

2 REPLIES 2

The problem is you're using <set></set> instead of <Set></Set>

Yes. In XML, case matters. And sadly, Apigee doesn't flag "unknown" or unexpected XML elements in the configuration.