【问题标题】:WSO2 ESB dynamic endpoint uriWSO2 ESB 动态端点 uri
【发布时间】:2013-07-05 20:10:25
【问题描述】:

我喜欢将许多附件保存到文件系统中。为此,我使用本教程中描述的方式: http://wso2.com/library/knowledge-base/2011/06/saving-mtom-attachments-using-vfs-transport

它正在工作,但我认为用相同的文件名保存所有文件没有意义。我需要为每个文件一个新的文件名,所以这行不通:

 <send>
   <endpoint name="endpoint_urn_uuid_121B17550AB61F010217054386886961-1720160132">
      <address uri="vfs:file:///home/amila/temp/vfs/woden-impl-dom-1.0-SNAPSHOT.jar"/>
   </endpoint>
 </send>

然后我发现了一个端点模板的问题:Dynamic Endpoint in WSO2

<send>
  <endpoint template="TemplateEndPoint">
    <parameter name="uri" value="http://localhost:8080/axis2/services/TaskService.TaskServiceHttpEndpoint/getTask" />
    <parameter name="name" value="Testing" />
  </endpoint>
</send>

如果我做对了,可以给这个端点一些参数,但只有值,没有表达式?我需要为 uri 提供一个表达式,例如,我可以将文件名保存在一个属性中并将这个文件名用作端点 uri。这可能吗?比如这样的:

<send>
  <endpoint template="TemplateEndPoint">
    <parameter name="uri" expression="get-property('fileendpoint')" />
    <parameter name="name" value="Testing" />
  </endpoint>
</send>

【问题讨论】:

    标签: file wso2 esb endpoint


    【解决方案1】:

    请尝试以下代码。

    <property name="transport.vfs.ReplyFileName"
                      expression="fn:concat(get-property('ID'), '.xml')"
                      scope="transport"/>
            <property name="OUT_ONLY" value="true"/>
            <send>
               <endpoint>
                  <address uri="vfs:file:///D:/Test/files/output/"/>
               </endpoint>
            </send>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多