We have created reference implementation as sample project to show how to use/integrate OpenHub framework with specific integration project.
GitHub: https://github.com/OpenWiseSolutions/openhub-ri
Maven modules:
<groupId>org.openhubframework.ri</groupId> <artifactId>ri-openhub</artifactId> |
<modules> <module>openhub-ext</module> <module>openhub-war</module> </modules> |
Dependency on OpenHub framework modules:
There are the following public interfaces
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 |
Service name | translates input text from/to specified language | |
---|---|---|
Type | Web Services | |
Authentification | HTTP Basic
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:
|