{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • API Design /
avatar image
1
Question by Oleksandr Skoryi · Apr 20, 2016 at 10:38 AM · 422 Views proxyassign message policy

Issue with proxy.pathsuffix

Hi everybody!

I want to have the proxy endpoint suffix like /session/open and real endpoint suffix /validateCredentials.

I create

        <Flow name="create">
            <Description/>
            <Condition>(proxy.pathsuffix MatchesPath "/session/open") and (request.verb = "POST")</Condition>
            <Request>
                <Step>
                    <Name>SaveMessageId</Name>
                </Step>
                <Step>
                    <Name>GetUsernameFromJSON</Name>
                </Step>
                <Step>
                    <Name>ReplaceSuffixForSessionOpen</Name>
                </Step>
            </Request>
            <Response>
                <Step>
                    <Name>OpenCache</Name>
                </Step>
            </Response>
        </Flow>

And create the step ReplaceSuffixForSessionOpen

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="ReplaceSuffixForSessionOpen">
    <DisplayName>ReplaceSuffixForSessionOpen</DisplayName>
    <Properties/>
    <AssignVariable>
        <Name>proxy.pathsuffix</Name>
        <Value>/validateCredentials</Value>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

I assume that then proxy suffix will be added to target endpoint URL, and be http://109.166.244.140:9763/webRS/services/user/validateCredentials instead of http://109.166.244.140:9763/webRS/services/user/session/open. What am I doing wrong?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Anil Sagar @ Google   · Apr 20, 2016 at 10:46 AM

@Oleksandr Skoryi ,

"proxy.pathsuffix" is read-only variable, you cannot write / update same. You can find same in variables reference documentation.

Regarding, changing target path, please find similar posts here.

Comment
Add comment Show 2 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Oleksandr Skoryi · Apr 20, 2016 at 03:16 PM 0
Link

But how can i deal with suffixes when i have loadbalancer on HTTPTargetConnection? I cann't pass fully changed URL in target.url variable. I Tried to use

    <Set>
        <Path>/webRS/services/user/validateCredentials</Path>
    </Set>

But it doesn't works properly

But in case when I have

    <AssignVariable>
        <Name>target.url</Name>
        <Value ref="">http://109.166.244.140:9763/webRS/services/user/validateCredentials</Value>
    </AssignVariable>
    <Set>
        <Path>/webRS/services/user/validateCredentials</Path>
    </Set>

it works perfect.

How can I set relative path without changing target.url?

avatar image GargiTalukdar Oleksandr Skoryi   · Apr 20, 2016 at 05:49 PM 0
Link

Hi @Oleksandr Skoryi,

Here you can use Javascript to dynamically set the target.url following the conditions.

Note that the target.url can be used only in targetEndpoint.

Regarding your question on how to deal with suffixes with loadbalancer in HTTPTargetConnection, I am guessing you are trying to add pathSuffix dynamically to target while using target server.

Here again you can use javascript to set a variable(here pathSuffixVar)with the required target pathSuffix and then use the variable in HTTPTargetConnection as below:

<Path>{pathSuffixVar}</Path>

Let me know if this helps.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to convert XML to x-www-form-urlencoded 2 Answers

Assign Message with multiple variables using Assign Variable 1 Answer

Apikey and OAuth support for same proxy endpoint 1 Answer

how to change target server? 2 Answers

Lookup Cache policy doesn't always retrieve the value 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges