0
votes

I have the following problem:

Develop a WSDL Based Proxy that calls several different SOAP Web services in parallel and returns the responses:

<inSequence>
<log level="full"/>
<iterate xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:agg="http://www.test.ro/aggregate"
  preservePayload="true"
  attachPath="//soapenv:Body"
  expression="//agg:AggregateRequest/agg:messageRequest">
    <target>
        <sequence>
            <property name="messageId"
            expression="//soapenv:Body/agg:messageRequest/agg:messageId[node()]"/>
            <property name="endpoint"
            expression="//soapenv:Body/agg:messageRequest/agg:endpoint[node()]"/>
            <xslt key="CleanPayload" source="/"/>
            <send>
                <endpoint key="MirrorEndpoint"/>
            </send>
        </sequence>
    </target>
</iterate>
</inSequence>

<outSequence>
<property name="resp" scope="default">
    <agg:AggregateResponse xmlns:agg="http://www.test.ro/aggregate"/>
</property>
<aggregate>
    <completeCondition timeout="10">
        <messageCount min="-1" max="-1"/>
    </completeCondition>
    <onComplete xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        expression="$body/*"
        enclosingElementProperty="resp">
        <log level="full"/>
        <send/>
    </onComplete>
</aggregate>
</outSequence>

My challenges are:

  • how do I pass the messageId from inSequence to outSequence so I can match the response to the request (similar to local environment from Message Broker)
  • how do I set the endpoint key with the text from agg:endpoint

I know this may be a newbie question but I'm having a hard time finding good tutorials on this topic.

Thank you

2

2 Answers

1
votes

When you set a property (scope default) inside the In Sequence, you can find back it's value inside the Out Sequence.

Set this property inside your In Sequence :

<property name="IN_MESSAGE_ID" expression="get-property('MessageID')"/>

you can use get-property('IN_MESSAGE_ID') in your Out Sequence

If you want to send a message to a dynamic address, you can set "To" header and use send mediator :

<header name="To" expression="get-property('MY_DESTINATION')"/>
<send/>
0
votes

Try setting the messageId as a HTTP header property,

 <header name="MessageId" value="0001" scope="transport"/>

And retrieve this header in the outSequence

<property name="MessageId" expression="get-property('MessageId')"/>

I havnt tested this out, so give a feedback on whether it works