In previous
exercise you learnt how to create a Proxy Service in JDev 12c
Now, you have seen how we created proxy service (SBDemoPS.proxy) the in our previous exercise. We are now going to create the Business Service using the XSD, WSDL and WADL created in our old post (click here to see the post)
This business service will be used to call the REST API, which is the Exchange Rate service (Fixer.io) to provide the desired result.
In our OSB flow, data is in XML format which is converted into JSON format by the WADL before making the actual call to the provided Exchange Rate (REST API) Service
We have made only a get operation in our WSDL and WADL in order to use one of the REST APIs exposed by Fixer.io
Please follow the below steps:-
Right click on 'External Services Pane' and select the 'REST'
Give a Meaningful name to the REST adapter as below:-
you will see this screen (see below)
In below screen, we need to add resources which your business service can hit. To add the resources, we will add the resources from WADL as given below:-
Select the WADL from the Application Resource Chooser as below:-
loading...
Resources will reflect as below:-
REST adapter will be created and your screen will look like as below:-
Business Service is created now. But it by default got created in 'Resources' folder only. We will move it to 'Business' folder as below:-
Now, once you open the REST Adapter (open by double clicking it), you will see only the WADL URL in 'service type' under 'General' tab.
It should have actually been showing WSDL URL and WADL URL both. For this, we will need to manually add the WSDL URL to this adapter. Also the WADL URL is not the one which we had selected in the wizard, instead wizard creates a new WADL file and its URL is linked in the Adapter which also need to be edited. To do all this, follow below steps:-
go to the business service folder location and open the REST Adapter in notepad to do some editing
In above code, we can see that only 'wadl' tag is present under 'binding' tag (line no. 5). We need to edit this and also need to add 'wsdl' as well, as below:-
As you must have seen that the business Service's REST Adapter was itself removed from the 'External Services' Swim-lane as soon as we moved the business service to 'Business' folder
Now, we need to add this Business Service back to 'External Services' Swim-lane as below:-
Right click on the 'External Services' Swim-lane and select 'Business Service'
KEYWORD: application components, communication protocol, black box, software application, metadata, service-orientation, loose coupling, distributed computing, modular programming, mashups, SaaS, cloud computing, Web services discovery, service contract, Service composition patterns, choreography, orchestration, Enterprise Integration Patterns, Web services, SOAP, web service specifications, Jini, CORBA, REST, Representational state transfer, interoperable, BPEL, High-level programming languages, WS-CDL, WS-Coordination, composite applications, portals, Service-oriented modeling, Service-oriented modeling framework (SOMF), project plan, enterprise architects, Component-based software engineering, scalability, software service engineering, Microservices, DevOps, SOA governance, Service granularity principle, OASIS SOA Reference Model