如何在WSO2中使用属性介体模式

时间:2019-07-01 09:55:42

标签: wso2 wso2esb wso2carbon

使用属性中介器模式时,出现内部服务器错误

  <?xml version="1.0" encoding="UTF-8"?>
  <sequence xmlns="http://ws.apache.org/ns/synapse" name="regex">
  <log level="custom">
  <property name="log" value="******************************"/>
  </log>
  <property name="regex" expression="$url:regex" scope="default" 
   type="string" pattern="(.|\s)*\S(.|\s)*" group="2"/>
  <property name="service_ep"
    value="http://www.mocky.io/v2/5d0086223200007700f9d561" />
  <header name="To" expression="get-property('service_ep')" />
  <log level="full"/>
  </sequence>

回应我得到的:

  <am:fault xmlns:am="http://wso2.org/apimanager">
  <am:code>0</am:code>
  <am:type>Status report</am:type>
  <am:message>Runtime Error</am:message>
  <am:description>Unknown type : string for the property mediator or the 
  property value cannot be converted into the specified type. 
  </am:description>
  </am:fault>

1 个答案:

答案 0 :(得分:0)

类型应为印刷体字母。

<property name="regex" expression="$url:regex" scope="default" 
   type="STRING" pattern="(.|\s)*\S(.|\s)*" group="2"/>

请参阅此文档。 https://docs.wso2.com/display/EI650/Property+Mediator#PropertyMediator-ConfigurationConfigs