issue with shared flow and servicecallout.requesturi

hello, I am using the same shared flow with a service callout in 2 different steps of my proxy and the second time the shared flow is called the service callout is failing becaure the parameter servicecallout.requesturi has the value of the first callout plus the second. as it is a shared flow I canot change the variable in it or it will be change for both service callout, how can I get rid of this issue or clear servicecallout.requesturi

0 3 104
3 REPLIES 3

Setting clearPayload="true" on your request element should fix this, but there's currently a known issue with it which you might be running into. As a workaround, use different variable names on each of your Request tags.

the clearpayload is already set to true.

I cannot change the variable name as it is in a shared flowed which is called twice within the same proxy.

 

One workaround I've used for this situation before is to use Request/Set/Path with a bare hostname in the URL, which seemed to work when called multiple times in my testing. The below example uses this method to call http://httpbin.org/anything :

 

<ServiceCallout async="false" continueOnError="false" enabled="true" name="SC-Test">
    <DisplayName>SC-Test</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myRequest">
        <Set>
            <Path>/anything</Path>
        </Set>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>calloutResponse</Response>
    <HTTPTargetConnection>
        <Properties/>
        <URL>http://httpbin.org</URL>
    </HTTPTargetConnection>
</ServiceCallout>