有来自wso2 Map the Parameters of your Backend URLs with the API Publisher URLs的文章 .
在其中,我们了解完整的发布商网址的外观:
http://<hostname>:8280/<context>/<version>/<API resource>
整个用例是:
您可以将变量定义为API资源的URI模板的一部分 . 例如,在URI模板/ business / / address /中,businessId是一个变量 . 使用具有“uri.var”的属性值在中介运行时期间读取资源中的变量 . 字首 . 例如,此HTTP endpoints 获取您在资源http:// localhost:8280 / businesses / / details中指定的businessId .
我想在调解期间访问 <version>
和 <context>
发布者网址的一部分 . 但是,当我使用表达式 uri.var.version
时,我将得到空字符串 . 或者,如果我在 <context>
中使用参数值,那么我将得到空字符串值 .
我的样本:
<context>: /test/{service}
<version>: 1.0
<API resource>: /{operation}/{account}
http://localhost:8280/test/{service}/1.0/{operation}/{account}
我可以从 <API resource>
映射参数,它的工作方式与预期的一样 . 但是当我试图得到 uri.var.service
或 uri.var.version
时,我总是得到空字符串值 .
是否有可能以某种方式在调解期间从 <context>
和 <version>
获取参数值?