How to: |
Syntax:
com.ibi.preemit.XDMultiPart
Description:
Multi Part Preemitter outputs a multipart document from the XML document. If the outgoing message is an email document, and if the user needs to create a multipart (.mpart) document from the XML message which underwent processing, this preemitter can be used. This is useful when the input message is an email message or a .mpart message which is processed by the iway channel and needs to be emailed back or written to the output as a multipart document. This could be used in conjunction with a multipart preparser which initially converts the input XML message into a format that can be used to call functions on the email such as _attcnt() (attachment count).
Parameters:
Parameter | Description |
---|---|
Debug | If true, debug mode is set. |
The Name and Description pane opens.
After you add the MultipartPreemitter to iWay Service Manager, create an outlet, PreemitterOutlet and add the MultipartPreemitter to this outlet. Create a file emitter which writes to a file a*.mpart. Also add the file emitter to this outlet. Construct the channel PreemitChannel using a file listener case1 as inlet which accepts * type of file as input (any file type), a simple move route and the outlet created in the previous step.
Let the input to this channel be testmp1.mpart as shown below.
content-type: multipart/mixed; boundary="----=_Part_1_8573456.1237437239687" content-length: 578 mime-version: 1.0 message-id: <9116239.1237437239765.JavaMail.kkauser@shoko2>
------=_Part_1_8573456.1237437239687 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=a.xml
<x>xxxx</x> ------=_Part_1_8573456.1237437239687 Content-Type: text/document Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=b.xml Content-Id: mydata1
<y>yyyyy</y> ------=_Part_1_8573456.1237437239687 Content-Type: text/document Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=c.xml Content-Id: mydata1
<y>zzzzz</y> ------=_Part_1_8573456.1237437239687–
The output obtained is a file a*.mpart:-
content-type: multipart/mixed; boundary="----=_Part_1_8573456.1237437239687" content-length: 578 mime-version: 1.0 message-id: <9116239.1237437239765.JavaMail.kkauser@shoko2>
------=_Part_1_8573456.1237437239687 Content-Type: application/xml Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=a.xml
<x>xxxx</x> ------=_Part_1_8573456.1237437239687 Content-Type: text/document Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=b.xml Content-Id: mydata1
<y>yyyyy</y> ------=_Part_1_8573456.1237437239687 Content-Type: text/document Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=c.xml Content-Id: mydata1
<y>zzzzz</y> ------=_Part_1_8573456.1237437239687-
The input multipart document is successfully moved through the channel and is written as a MIME output to the output directory.
iWay Software |