3

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.

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?

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>

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

Community
  • 1
  • 1
Philipp
  • 4,645
  • 3
  • 47
  • 80

1 Answers1

4

Try with property scope as "default/synapse"

FiveO edit comment:

Try with property scope as "default":

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>
Ratha
  • 9,434
  • 17
  • 85
  • 163
  • no - I get this error: org.apache.synapse.SynapseException: Only 'axis2' or 'transport' or 'axis2-client' values are allowed for attribute scope for a property med iator, Unsupported scope default/synapse – Philipp Nov 14 '12 at 11:58
  • How did you defined the scope? – Ratha Nov 14 '12 at 14:36
  • 1
    Thanks I was able to achieve the result by sending the properties within the "default" scope to the outSequence. I'll modify your answer with some examples. – Philipp Nov 14 '12 at 19:39
  • Thanks..i added your comment in the answer – Ratha Nov 15 '12 at 04:52
  • @Ratha I need to send string value as response using class mediator.Here is my question https://stackoverflow.com/questions/45132859/how-to-send-response-as-string-using-class-mediator-in-wso2-esb. Do you have any idea about this thank you – Priyantha Jul 17 '17 at 05:51