Version: 17.07
Supported Since: 17.07
I want to direct my web service calls by introducing a soap versioning service of the UltraESB-X. This service is not supposed to do processing and it will directly route the received SOAP messages to the appropriate SOAP version based service.
As shown in the following diagram, ESB will come in between the actual end user and the back end services.
UltraStudio Configuration
UltraESB-X Configuration
In order to implement above use case you must first select following dependencies when you are creating a new Ultra project.
HTTP NIO Connector from the connector 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 “soap-sample-flow”, and then add required components by going through following steps in order.
Add a HTTP NIO Ingress Connector from the Connectors → Ingress Connectors list, to accept the HTTP requests from the user. NIO HTTP Listener’s basic parameters should be filled as below to expose a service at port 8280 on the resource path /service/soapService
Add three Processors of type HTTP NIO Egress Connector from the Connectors → Egress Connectors list, to send the received request to the actual back end services. For that NIO HTTP Egress Connector’s basic parameters should be filled as below table.
Add a SOAP Router from the Processors → SOAP Router, to route the SOAP messages based on the version. No configurations are required for the element.
Add two Processors of type SOAP Action Setter from Processors → SOAP Action Setter, to set the SOAP action of the message. The basic parameters should be filled as below to set the SOAP Action
Add two Processors of type SOAP Action Getter from Processors → SOAP Action Getter, to get the SOAP action and include it as a scope variable of the message.
Add respective Logger elements to verify the SOAP action headers obtained from the scope variable.
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.
Design View
Text View
1. NIO HTTP Ingress Connector
3. SOAP Action Setter
4. SOAP Action Setter
5. SOAP Action Getter
6. SOAP Action Getter
7. Logger
8. Logger
9. Logger
10. NIO HTTP Egress Connector
11. NIO HTTP Egress Connector
12. NIO HTTP Egress Connector
1. NIO HTTP Ingress Connector
|
8280 |
|
/service/soapService |
3. SOAP Action Setter
|
soap11Action |
4. SOAP Action Setter
|
soap12Action |
5. SOAP Action Getter
|
SOAP_ACTION_NAME |
6. SOAP Action Getter
|
SOAP_ACTION_NAME |
7. Logger
|
@{variable.SOAP_ACTION_NAME} |
|
INFO |
8. Logger
|
@{variable.SOAP_ACTION_NAME} |
|
INFO |
9. Logger
|
Default Message |
|
INFO |
10 .NIO HTTP Egress Connector
|
URL |
|
localhost |
|
9001 |
|
/service/soap11Service |
11 .NIO HTTP Egress Connector
|
URL |
|
localhost |
|
9002 |
|
/service/soap12Service |
12 .NIO HTTP Egress Connector
|
URL |
|
localhost |
|
9003 |
|
/service/defaultService |
Now you can run the Ultra Project and check the functionality of the integration flow. Create an UltraESB Server run configuration and start it.
When running the sample in the UltraESB-X distribution, you need to override the following properties in-order for the sample to work. The properties file is located at $ULTRA_HOME/conf/projects/soap-service-versioning/default.properties
Refer to Managing Project Properties documentation on how to override properties. |
soap-service-flow.ingress-connector.port |
The Service Port of the listener (default value is 8280) |
soap-service-flow.ingress-connector.servicePath |
The Service Path of the listener (default value is /service/soapService) |
soap-service-flow.egress-connector-soap11.servicePath |
The Service Path of the listener (default value is /service/soap11Service) |
soap-service-flow.egress-connector-soap11.host |
The Service Path of the listener (default value is localhost) |
soap-service-flow.egress-connector-soap11.port |
The Service Path of the listener (default value is 9001) |
soap-service-flow.egress-connector-soap12.servicePath |
The Service Path of the listener (default value is /service/soap12Service) |
soap-service-flow.egress-connector-soap12.host |
The Service Path of the listener (default value is localhost) |
soap-service-flow.egress-connector-soap12.port |
The Service Path of the listener (default value is 9002) |
soap-service-flow.egress-connector-default.host |
The Service Path of the listener (default value is localhost) |
soap-service-flow.egress-connector-default.port |
The Service Path of the listener (default value is 9003) |
soap-service-flow.egress-connector-default.servicePath |
The Service Path of the listener (default value is /service/defaultService) |
After that navigate to $ULTRA_HOME/bin directory. Next you can run the UltraESB-X distribution with following command to start the engine with this sample project deployed.
./ultraesbx.sh -sample soap-service-versioning
Send a POST HTTP request containing any payload to http://localhost:8280/service/soapService. (You can use the HTTP Client shipped with Ultra Studio Toolbox for this purpose). You will get a response with the same content you have included in the request since our backend is an echo server. Our backend servers have been implemented as three separate integration flows included in the directory back-end-server-mock.
If required you could use your own back end servers by changing the respective ports and end points.