1
votes

There are numerous examples of using the mailto transport in WSO2 ESB to send emails (based on filter mediator, fault sequence etc.). However, I have attempted this a number of ways all with the same result i.e. that the proxy service never terminates. I am testing this using SOAPUi. This is my proxy service

<proxy xmlns="http://ws.apache.org/ns/synapse" name="TMCService" transports="https,http" statistics="enable" trace="enable" startOnLoad="true">
<target inSequence="gov:/trunk/sequences/seqGetTMCData">
    <outSequence>
      <filter xmlns:trac="http://mynamespaceuri" xpath="//trac:SaveIncidentsResponse">
        <then>
           <log level="full"/>
           <property name="Subject" value="CEP Event" scope="transport"/>
           <property name="OUT_ONLY" value="true"/>
           <send>
              <endpoint>
                 <address uri="mailto:[email protected]"/>
              </endpoint>
           </send>
        </then>
        <else>
           <send/>
        </else>
     </filter>
   </outSequence>
 </target>
 <description></description>
</proxy>

the email sends no problem with the response from the inSequence - no problem, it just never terminates. I have to manually stop it in SOAPUi to stop. I've tried putting drop after the send in the then element, that doesn't work either. I guess I am missing something fundamental in how I am understanding the out sequence to work, but this is pretty much lifted from the many examples out there and no one else appears to be having the same issue as me. Any suggestions/ pointers?? WSO2 ESB v4.5.1

1

1 Answers

1
votes

I have resolved this by cloning the response message, sending one to the mailto transport and sending the other one as a default send (no endpoint) which returns back to the client. Kind of makes sense as the OUT_ONLY property is explicitly saying there will be no response, so have ensure that the client receives one by cloning the message.

Still welcome any other comments if there is another way of doing this without clone mediator.

So why doesn't the examples show this!