简体   繁体   English

如何在WSO2上恢复端点生产/沙箱

[英]How to retreive Endpoint Production / Sandbox on WSO2

I have an API which integrated with WSO2_APIM version 2.1.0 我有一个与WSO2_APIM版本2.1.0集成的API

And what i want achieve, How i can retrieve current Endpoint(Defined on API Publisher - Implement Tab) used which using environment(Production / Sandbox) on my .xml File(Which declared on In Sequence). 我想实现的目标是,如何使用.xml文件(按顺序声明)上的环境(生产/沙箱)检索当前的端点(在API Publisher-Implement选项卡上定义)。 The purpose for Sequence(.xml File) can filter environment used between Production / Sandbox, which will be used for Set Address Endpoint with Call Mediator. Sequence(.xml文件)的用途可以过滤在Production / Sandbox之间使用的环境,该环境将用于通过Call Mediator设置地址端点。

Hope Someone can give any ideas. 希望有人能提出任何想法。 Thanks for any comments & responses. 感谢您的任何评论和回应。

You can find the environment that current request being used through 'AM_KEY_TYPE' property. 您可以通过“ AM_KEY_TYPE”属性找到当前请求正在使用的环境。 You can use the filter mediator inside your sequence to check the value of that property. 您可以在序列内部使用过滤器介体来检查该属性的值。 If it is 'PRODUCTION' then, the current environment is prod and else it is sandbox. 如果是“生产”,则当前环境为prod,否则为沙箱。

<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
        <then>
            <!--Your logic for prod case-->
        </then>
        <else>
             <!--Your logic for sandbox case-->
        </else>
</filter>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM