2017-09-08 17 views

答えて

0

ペイロードファクトリメディエータを使用して、電子メール本文のメッセージコンテンツを以下のように定義することができます。あなたは電子メールの添付ファイルとメッセージ本文を定義したい場合は

<?xml version="1.0" encoding="UTF-8"?> 
<proxy xmlns="http://ws.apache.org/ns/synapse" 
     name="mailtest" 
     startOnLoad="true" 
     statistics="disable" 
     trace="disable" 
     transports="http,https"> 
    <target> 
     <inSequence> 
     <send> 
      <endpoint> 
       <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> 
      </endpoint> 
     </send> 
     </inSequence> 
     <outSequence> 
     <payloadFactory media-type="xml"> 
      <format> 
       <test xmlns="">$1</test> 
      </format> 
      <args> 
       <arg xmlns:ax21="http://services.samples/xsd" 
        xmlns:ns="http://services.samples" 
        evaluator="xml" 
        expression="//ns:getQuoteResponse/ns:return/ax21:name"/> 
      </args> 
     </payloadFactory> 
     <property name="Subject" scope="transport" value="Sample Mail"/> 
     <property name="OUT_ONLY" scope="default" type="STRING" value="true"/> 
     <property name="messageType" 
        scope="axis2" 
        type="STRING" 
        value="text/plain"/> 
     <property name="OUT_ONLY" value="true"/> 
     <send> 
      <endpoint> 
       <address uri="mailto:[email protected]"/> 
      </endpoint> 
     </send> 
     </outSequence> 
    </target> 
    <description/> 
</proxy> 

は、「transport.mail.bodyWhenAttached」プロパティを使用します。

関連する問題