-
Notifications
You must be signed in to change notification settings - Fork 0
Crate New Forex RESTful Service
Sachin Bhosale edited this page Aug 21, 2017
·
11 revisions
-
Create RESTful Service project
com.digital.banking.forex.rest
from OCB Templates - Refer page -
Create new
FxRate
java bean to store Forex Rate. Refer sample FxRate bean here -
Create new
ForexServiceImpl
class or refactor existingProductServiceImpl
class to use FxRate bean. -
Add Sample Forex Rates - refer sample forex rates
-
If you have created new class for service, then add new
<jaxrs:server>
bean forForexServiceImpl
. Or if existingProductServiceImpl
is updated then you can update<jaxrs:server>
bean accordingly.
<jaxrs:server id="foreRestService" address="/forexes">
<jaxrs:providers>
<ref bean="jaxbXmlProvider" />
<ref bean="jsonProvider" />
</jaxrs:providers>
<jaxrs:serviceBeans>
<ref bean="forexServiceImpl" />
</jaxrs:serviceBeans>
</jaxrs:server>
- Note the
<ref bean="forexServiceImpl>
andaddress="/forexex"
changes
- If you have added new package, you need to add the package in component-scan as show below
<context:component-scan base-package="<pkg1>,<pkg2>" />
-
Now open
launch.bndrun
and resolve to get all runtime dependencies. -
Click on
Run OSGi
to run the service. -
Open browser and go to http://localhost:8888/services/forexes to see the service running
- Development Environment Setup
- OCB Eclipse Workspace Setup
- Getting OCB Release in Workspace
- OCB Connectivity Check
- Create Simple RESTful Service
- Create Forex RESTful service
- Create Forex API Project
- Create ForexRate Provider project
- Write Forex Service JUnit testcase
- Create Forex Integration Test Project
- Forex Service Deployment
- OCB A la carte services
- Forex Service consuming Security Service