I have an integer multiplication web service exposed over HTTP, and want to make it accessible via email, where emails containing the input data sent to a predefined address are processed and replied to with the multiplication results.
UltraESB-X can be configured to proxy messages between the email service and the web service in order to enable the acceptance of data from and propagation of results to email senders.
In order to implement above use case you must first select following dependencies when you are creating a new Ultra project.
Mail Connector from the connector list
NIO HTTP Connector from the connector list
Transport Header Manager from processor list
|If you have already created a project, you can add above dependencies via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list and Processors list, select above dependencies.|
To implement above use case, first create an integration flow named “web-service-via-email-flow”, and then add required components by going through following steps in order.
Add a Mail Ingress Connector from the Connectors → Ingress Connectors list, to accept incoming multiplication request emails, with the configuration shown below (assuming a Gmail account)
Add an Add Variable processing element from the Processors → Generic list, to extract the value of the retained
From header (sender’s email address)
Add a NIO HTTP Egress Connector from the Connectors → Ingress Connectors list, to forward the received request to the multiplication web service
Add an Add New Transport Header processing element from the Processors → Header Manipulation list, to set the subject of the response email
Restore the previously saved sender’s email address from
recipient variable into the
mail.to transport header,
using another Add New Transport Header processing element
Add a Mail Egress Connector to send the response back to the sender (assuming a Gmail account)
Finally add a Successful Flow End processing element to complete the flow
The completed integration flow should look like below.
Configuration for each element is as below. The numbering corresponds to the numbers shown in above diagram.