将属性从 inSequence 传递到 outSequence [英] Pass property from inSequence to outSequence

查看:14
本文介绍了将属性从 inSequence 传递到 outSequence的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向 HL7 TCP/IP 端口发送带有代理的消息,并在 outSequence 中获得响应.但我的问题是 inSequence 中设置的所有属性都不再可用.它们都是空的.我测试了所有不同的范围(transport、axis2、axis2-client),但都没有工作.

I'm sending a message with a Proxy to a HL7 TCP/IP port and get the response in the outSequence. But my problem is that all properties set in the inSequence are not anymore available. All of them are null. I tested with all the different scopes (transport, axis2, axis2-client), but none of them worked.

我在这篇文章中看到它应该是可能的.HL7 发件人是否破坏了属性?如何在 outSequence 中使用 inSequence 中的属性?

I saw in this post that it should be possible. Is the HL7 sender destroying the properties? How can use my properties from the inSequence in the outSequence?

我的代理示例(从 ActiveMQ JMS 获取消息并发送到 HL7 端口 4000):

Example of my Proxy (get message from ActiveMQ JMS and sends to HL7 port 4000):

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" xmlns:hl7="http://wso2.org/hl7"  xmlns:urn="urn:hl7-org:v2xml" name="demo_toHL7" transports="jms" startOnLoad="true" trace="disable">
    <parameter name="transport.jms.Destination">demo_qFilter</parameter>
    <parameter name="transport.jms.ConnectionFactory">queueBlocking</parameter>
    <parameter name="transport.jms.DestinationType">queue</parameter>
    <parameter name="transport.jms.ContentType">
        <rules>
            <jmsProperty>contentType</jmsProperty>
            <default>application/edi-hl7</default>
        </rules>
    </parameter>
    <target faultSequence="rollbackSequence">
        <inSequence>
            <log level="full"/>
            <property name="ClientApiNonBlocking" scope="axis2" action="remove"/>
            <property name="testProperty" value="blabla" scope="transport"/>
            <property name="messageType" value="application/edi-hl7" scope="axis2"/>
            <property name="ContentType" value="application/edi-hl7" scope="axis2"/>            
            <send>
                <endpoint>
                    <address uri="hl7://localhost:4000"/>
                </endpoint>
            </send>
        </inSequence>
        <outSequence>
            <log level="custom">
                <property name="PROPERTY" expression="get-property('transport','testProperty')"/>
            </log>
        </outSequence>
    </target>
</proxy>

<小时>

我正在使用 WSO2 ESB 4.0.3 并安装了 HL7 功能.作为接收者,我使用 7edit 应用程序.


I'm using WSO2 ESB 4.0.3 and installed the HL7 Feature. As receiver I use the 7edit application.

推荐答案

尝试将属性范围设置为default/synapse"

Try with property scope as "default/synapse"

FiveO 编辑评论:

FiveO edit comment:

尝试将属性范围设为默认":

Try with property scope as "default":

将传输属性从 inSequence 发送到 outSequence(代表默认范围):

Sending a transport property from the inSequence to the outSequence (on behalf of the default scope):

<inSequence>
   ...
   <property name="myPropertyInTransport" value="myValue" scope="transport"/>
   <property name="myPropertyInDefault" expression="get-property('transport','myPropertyInTransport')" scope="default"/>
   ...
</inSequence>
<outSequence>
   ...
   <property name="myPropertyInTransport" expression="get-property('default', 'myPropertyInDefault')" scope="transport"/>
   <!-- Now myProperty is also available in the outSequence -->
   ...
</outSequence>

这篇关于将属性从 inSequence 传递到 outSequence的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆