1

I configured Proxy Service parameter according to the documentation:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="CQProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
       ...
   </target>
   <parameter name="TestParam">ParamValue1</parameter>
</proxy>

Now I need to access it from within the sequence. Is there any way to do it?

I tried accessing it using script mediator:

 <script language="js">mc.setProperty("TestParamProp", mc.getParameter("TestParam"))</script>

but it throws "Cannot find function getParameter." error.

Please advice.

4

2 回答 2

2

使用以下内容从脚本中介访问 ESB 参数

<script language="js"> var test_param = mc.getProperty('TestParam') </script>

使用以下内容将脚本中介中的参数检索回 ESB

mc.setProperty("newParam",test_param)
于 2013-07-09T09:01:24.333 回答
0

以 json 格式输入并尝试下面给出的代码,

<property name="TestParam" expression="json-eval($.TestParam)"></property>
<script language="js">
mc.setProperty("TestParamProp", mc.getProperty("TestParam"));
</script>
于 2015-01-14T10:54:20.910 回答