Now I will show how to consume an incoming email.
Again, I am using JAMES
- in the last post I configured the UMS email driver for incoming emails for POP3 on port 110
These settings did not work OOTB for this lab - a vielen Dank to my colleague ChristianS for assisting me on this. He advised me to set the port to 115 and all worked. So be warned, just in case you have a similar issue.So essentially I edited the setting in em for the email driver and also set the port to 115 in JAMES -
The JAMES config.xml is in the directory - \james-2.3.1\apps\james\SAR-INF
So now to the implementation -
I have the following simple composite that writes an order -
I specified the following Order.xsd when defining the service SendOrder -
However, service creation results in a new xsd being created in the project -SendOrder.xsd
This xsd is defined as follows -
Now to the consuming composite -
As you can see, I read in the email, pass it on to the mediator and then write the order to a file.
I add order.xsd to the project.
I create a new xsd called SentOrder.xsd and copy and paste in the contents of SendOrder.xsd.
The file adapter is defined using the Order.xsd shown above.
The IncomingOrder is defined as follows -
Notice the xsd is set to SentOrder.xsd
Deploy and test - Here I send the email order for 1 iToaster
Email has been sent
Now to the receiving process -
Check my file -