Reference implementation
We have created reference implementation as sample project to show how to use/integrate OpenHub framework with specific integration project.
Implementation details
GitHub: https://github.com/OpenWiseSolutions/openhub-ri
Maven modules:
- openhub-ext: routes and business logic implementation
- openhub-war: WAR build
<groupId>org.openhubframework.ri</groupId> <artifactId>ri-openhub</artifactId>
<modules> <module>openhub-ext</module> <module>openhub-war</module> </modules>
Dependency on OpenHub framework modules:
Public services
There are the following public interfaces
Latest exchange rate (REST)
Service name | latest exchange rate for specified two currencies |
---|---|
Type | REST |
Authentification | - |
URL | GET /http/exchange/v1/latest |
Input parameters | URL parameters: ?source=EUR&target=CZK
|
Output | text/plain latest rate as number (Double) |
Input route | org.openhubframework.openhub.ri.in.exchange.ExchangeRestInRoute |
Implementation | Uses output internal route org.openhubframework.openhub.ri.out.exchange.GetExchangeRateRoute that calls external service at http://fixer.io Unit tests: org.openhubframework.openhub.ri.out.exchange.GetExchangeRateRouteTest We use restito for integration tests of REST services, see org.openhubframework.openhub.ri.integration.GetExchangeRateIntegrationTest |
Translate (Web Services)
Service name | translates input text from/to specified language |
---|---|
Type | Web Services |
Authentification | HTTP Basic # username and password for accessing web service of this integration platform by other systems security.user.ws-user=wsUser security.user.ws-password=wsPassword Note: default from OpenHub framework |
URL | WSDL /ws/translate.wsdl |
Input parameters |
|
Output |
|
Input route | synchronous: org.openhubframework.openhub.ri.in.translate.SyncTranslateWsRoute asynchronous: org.openhubframework.openhub.ri.in.translate.AsyncTranslateWsRoute |
Implementation | There are stub implementations for both routes (input parameters are logged for asynchronous message and some constant text is returned for synchronous message). Goal is to present concept how to create sync/async routes with web services ... Unit tests:
|