Professional Documents
Culture Documents
Proces Email With The New UMS Adapter of SOA Suite PS5
Proces Email With The New UMS Adapter of SOA Suite PS5
Here we can set some defaults, like the default mail address, Cost and Speed ( cpu priority )
The incoming settings are more complex because I will read two mail accounts, this is
because I need one mail account for every polling UMS adapter.
To make this work I can use a , between the values so for IncomingMailIDs I use this as
value [email protected],[email protected] , do the same for IncomingUserIDs = soa,soa2 and for the
IncomingUserPasswords, I use CleartextPassword and also use a , between the passwords.
Restart the SOA Suite server.
name and remove the preview = true attribute. Now You will see the new UMS adapter in
your SOA Component Palette.
Choose for Outbound Send Notification. You can choose to receive the Mail Message Id as
response, else it will be One Way.
For Message Schema you got 3 options ( this talks about the mail body ) , off course
Opaque, Message is a big String or based on a XML Schema.
Next we can take a look at incoming part of the UMS adapter. Drag the UMS adapter to
exposed Services side of the composite.
Dont change the default Connection JNDI Name
Choose Listener as Operation Mode, Polling does not work in this Preview Adapter and the
UMS email driver already polls every few seconds.
Provide the mail adress this must match with your incoming UMS configuration.
We can also define a message filter which can accept or ignore the incoming mails. The
pattern string should be a java regexp. To test this pattern you can use this url
http://www.regexplanet.com/advanced/java/index.html
Too bad this feature does not work yet in this technical preview.
And also you can do a custom Java Callout ( I didnt test it and dont know the possibilities of
this feature).
To test this I need to add the employee xml in the body of the mail ( not as attachment) and
send it to [email protected]. As response I will get a mail.
The request I will receive in SOA Suite.
For this I will use the second mail address [email protected] and also change the message type
to String. A BPEL service component will write these attachments to a server location.
This is the request I received in the BPEL component. You can see that we only get a
reference to the attachments.
So in BPEL we need to use a ForEach to handle every attachment and write this to a file.
To load the attachment and assign it to the file adapter input variable I need to
use ora:getAttachmentContent
<assign name=AssignInput>
<copy>
<from>ora:getAttachmentContent(ReceiveMail_InputVariable,'body
,/ns3:message/ns3:attachment/ns3:Attachment[$ForEachCounter])
</from>
<to>$InvokeWriteFile_InputVariable.opaque</to>
</copy>
</assign>