将属性从inSequence传递到outSequence [英] Pass property from inSequence to outSequence
问题描述
我正在将带有代理的消息发送到HL7 TCP/IP端口,并在outSequence中获得响应.但是我的问题是inSequence中设置的所有属性都不再可用.它们都是空的.我测试了所有不同的范围(传输,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.
推荐答案
尝试将属性范围设置为默认/突触"
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屋!