Hi All,
We are trying to upload image file fetched from salesforce to apigee baas with edge using service callout.
We are getting binary response from target and directly storing that response to baas as below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="sc_postimgtobaas">
<DisplayName>sc_postimgtobaas</DisplayName>
<Properties/>
<Request clearPayload="true" variable="myRequestx">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set> <Headers> <Header name="Content-Type">application/octet-stream</Header> </Headers> <Payload Content-Type="application/octet-stream">{response.content}</Payload> <Verb>POST</Verb>
</Set>
</Request>
<Response>calloutResponsex</Response>
<HTTPTargetConnection> <URL>https://api.usergrid.com/vchikane/sandbox/tests/{uuid}</URL> </HTTPTargetConnection>
</ServiceCallout>
with this service callout, files meta data is getting created in baas, but with content type as Application/Octet-Stream.entitycreatedbyapiproxycall.txt
The same request we are trying using Postman Rest client, it'w working properly.postman-call.jpg
entitycreatedbypostmancall.txt
I tried using Request method in javascript policy also using Service Callout Policy. I cac see that image using postman(send and download) by hitting the proxy which fetches image from salesforce. But when response of that service callout I try to store in BaaS then I am not able to fetch the Image from Baas, because it's not recognizing it I guess.
Attaching the sample proxy bundle which gets an Image from Google and stores it to BaaS, also trace logs for the same.salesforce-connectivity-rev7-2016-10-25.zip