Table of Contents

Send Mail with XML

Dataservice / proxy (real endpoint)

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="proxy"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target endpoint="endpoint"
           inSequence="cache"
           outSequence="sendMailSequence"/>
   <description/>
</proxy>

External Endpoint

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="endpoint">
   <address uri="http://localhost/services/getTYP/get" format="get">
      <suspendOnFailure>
         <progressionFactor>1.0</progressionFactor>
      </suspendOnFailure>
      <markForSuspension>
         <retriesBeforeSuspension>0</retriesBeforeSuspension>
         <retryDelay>0</retryDelay>
      </markForSuspension>
   </address>
</endpoint>

Mailto Sequence

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="sendMailSequence" xmlns="http://ws.apache.org/ns/synapse">
    <log level="custom">
        <property name="status" value="Sending the mail now"/>
    </log>
    <property name="messageType" scope="axis2" type="STRING" value="application/xml; name=data.xml"/>
    <property name="ContentType" scope="axis2" type="STRING" value="application/xml; name=data.xml"/>
    <property name="Subject" scope="transport" type="STRING" value="Soubor"/>
    <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
    <send>
        <endpoint name="MailEpr">
            <address uri="mailto:noreply@janforman.com"/>
        </endpoint>
    </send>
</sequence>

Cache

<sequence name="cache">
        <cache collector="false" timeout="5000">
            <protocol type="HTTP">
                <methods>*</methods>
                <headersToExcludeInHash/>
                <responseCodes>.*</responseCodes>
                <enableCacheControl>false</enableCacheControl>
                <includeAgeHeader>false</includeAgeHeader>
                <hashGenerator>org.wso2.carbon.mediator.cache.digest.HttpRequestHashGenerator</hashGenerator>
            </protocol>
        </cache>
</sequence>