Not able to remove/reset the servicecallout.requesturi variable

Not applicable

I have the following flow in my proxy:

  1. Request to my proxy comes in with /users.
  2. Proxy request flow: Service Callout1 is made successfully. I notice the servicecallout.requesturi is populated as HTTPTargetConnection url minus the host name.
  3. Target call successful
  4. Proxy response flow: Service Callout2 is failing because the servicecallout.requesturi is now populated as <servicecallout.requesturi> for Service Callout2 + <servicecallout.requesturi> for Service Callout1.

servicecallout.requesturi in step #2 above

/servicecall1

servicecallout.requesturi in step #4 above

/servicecall2/servicecall1

I don't want the "/servicecall1" getting automatically attached.

I tried an AssignMessage policy immediately after ServiceCall1 (see below), but it is not helping.

How can I manipulate it? If I cannot, how am I supposed to make multiple Service Calls in a flow?

Assign Message Policy I am using:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Reset_SC_Variables">
    <DisplayName>Reset_SC_Variables</DisplayName>
    <Properties/>
    <AssignVariable>
        <Name>servicecallout.requesturi</Name>
        <Value/>
        <Ref/>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
Solved Solved
0 2 945
1 ACCEPTED SOLUTION

haider_imran
Participant III

Hi Ritwik,

The request variable in both service callout policy cannot be same , kindly check you might have both same request variable which is causing to append "servicecallout.requesturi" as /servicecall2/servicecall1

Same issue is already highlighted on below mentioned community link, kindly also review this

https://community.apigee.com/questions/3903/is-servicecalloutrequesturi-set-every-time-service.html

Thanks,

Haider

View solution in original post

2 REPLIES 2

haider_imran
Participant III

Hi Ritwik,

The request variable in both service callout policy cannot be same , kindly check you might have both same request variable which is causing to append "servicecallout.requesturi" as /servicecall2/servicecall1

Same issue is already highlighted on below mentioned community link, kindly also review this

https://community.apigee.com/questions/3903/is-servicecalloutrequesturi-set-every-time-service.html

Thanks,

Haider

Not applicable

I'm trying to understand the use case for this. Why not setting URL element using variables? For instance:

<HTTPTargetConnection>
  <Properties/>
  <URL>https://{_REQUEST_URI}/{_PATH}/resource?ql=select * where name = '{ANOTHERR_VARIABLE}'</URL>
</HTTPTargetConnection>