Friday, 1 September 2017

REST OSB SOA 12C Integration using JSON

In this Blog, I will discuss how Oracle Service Bus (OSB) 12c can be used to transform enterprise system interfaces into a mobile-optimized REST-JSON API. In this Blog, we will Create an application, which will consume JSON message from MAF using REST adapter in OSB 12C. OSB will SOA service called business process and SOA will ultimately invokes the database or backend. Thus, it involves an integration of MAF -> OSB -> SOA -> Backend(data Layer)


But how to do it boss. We will start building components using bottom up approach. See our requirement is very simple. We want to fetch Employee Data (name and Status) based on EmployeeId. From mobile application user will enter employeeID and click on search. Request will hit OSB. OSB will get JSON input and after transformation to respective xml message, sends it to SOA Layer. SOA will consume xml message and will call database where employee records are placed. And will retrieve the employee record based on EmployeeID passed. OSB will again convert xml response to JSON response and sends back to Mobile application.



So first thing here is to create database table and put some employee records.
  • Create Employee table




  • After Creating Table, we need to create SOA Service which will use database adapter to Fetch Employee record based on EmployeeId.






  • We have used Mediator service to call Database Adapter. FetchEmployeeDetails is database adapter which is used to call Employee table.

 We have completed one half part of the usecase. Let’s test it and note down the results.

Request:-



Response:-



Note down the Endpoint of this SOA Service




This is simple man, why I’m wasting my time in reading your blog.   I already knew this..
Wait, wait. Actual part is coming now, where we are gonna consume this SOAP/xml service in OSB and will expose it as REST Get .





 Create OSB Application and OSB project as below





Right click on the Proxy Services swimlane and Choose REST option.



In the Create REST Binding window, give the relevant name to service.   Example:- RESTEmployeeDetailsService


Also, We need to choose relative Resource Path. Double click on Resource Path.


Here , we have choose relative path as /EmployeeId/{EmployeeId}.  By putting it in {} braces, means it will be passed with actual value of EmployeeId in the request URL. The actual URL which user needs to call will become like highlighted in below screenshot.  Example:-

will define <proxy-uri> later


  • After defining Resource path,  we need to define Operation Bindings. For that ,we need to click on + sign and choose the option ‘Add Operation Binding’





  • Give the relevant name on Operation field and choose the HTTP Verb as below.




  • Click on the response tab and choose the format as JSON. Also click on highlighted button to  create the native schema for JSON response




  • Give the File Name nxsd_GetEmployeeDetails.xsd(Any Relevant name)for xsd and click next






  • Choose the ‘JSON Interchange format’ and click next







  • Enter a sample JSON Payload for the response.  Now, where to get this. I don’t know how to get JSON format for the SOA service response.  










  • Copy the JSON response sample  and paste it Sample section of below window:-





  • Jdeveloper will create Native Schema file for sample JSON format as below:-





  • After clicking OK, the control will return to below page and will create nxsd_GetEmployeeDetails.xsd in the JdeveloperProject.




  • Operation has been created as below and click OK.




  • After that we need to create Pipeline in OSB by right clicking on Pipeline/Split-Join swimlane and choose Pipeline as below





  • Select wsdl option and click on browse to choose REST wsdl created while performing above steps:-





  • Choose the wsdl ‘RESTEmployeeDetailsService.wsdl’ and click OK




  • Click Finish and it will create Pipeline in the Project.





  • After that we need to create Business service in OSB to call SOA Service by right clicking on External  Servicesswimlane and choose Business Service as below




  • In the selection field,  enter the end point of SOA service, which we have noted earlier and click ok.




  • Click Next





  • Click Finish





  • OSB composite will look like below:-




  • Now we need to create transformation of Source data to Target data as both have different formats. We can achieve this with the help of Xquery in OSB.
  • Let’s first create xquery for source (Request) transformation.
  • Create new xquery resource and give it any relavant name and click on Green + sign in the source section.




  • After that click on the edit button as below steps:-






  • Since, we are getting EmployeeId as string , so choose string from the Type Choose and click ok





  • Now comes the target section. Here we need to  call SOA service. So, we want to convert our string input to the Target SOA Service input. So  choose below highlighted type as it is derived from SOA service xsd.


















  • After that we need to use Replace activity to apply input transformation in the pipeline as below:-




  • Similarly, we will create xquery Response Transformation which will convert SOA service response format to the OSB REST output. Please perform as below:-














After deploying the code on OSB server, we need to test it.  There are many ways to test it.  However, we have covered 2 below ways:-
·        Testing it from Browser
·        Testing it using Advanced REST Client
How to get the full endpoint to test it. So,  Please check the proxy service endpoint






So the full endpoints will be :-





Testing it from Browser:-






Testing it from Advanced REST client:-


Not able to view Resource folder in Bpel Project

I had created BPEL project in soa 12c. After some days, I noticed my project is not showing Resources folder.
After spending so much time, i found below solution:-


  1. Go to Project .jpr file
  2. Right click and edit it in notepad
  3. Remove the below highlighted code from .jpr file

       4. Save the file. You will be able to see the resource folder.

Tuesday, 29 August 2017

we don't remember weblogic admin password

 we can get it as below:


[applmgr@ebs1213 ~]$ sh /u01/app/oracle/ebsappl/FIN2DB/fs1/FMW_Home/wlserver_10.3/common/bin/wlst.sh


Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> domain="/u01/app/oracle/ebsappl/FIN2DB/fs1/FMW_Home/user_projects/domains/EBS_domain_FIN2DB"
wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
wls:/offline> print encryption.decrypt("{AES}Gp7Q+3yqpimz1+27+ftmbCRHpgkMTpEZc67RsxM9XS0=")
weblogic@123
wls:/offline>

We can get encrypted password from boot.properties.

[applmgr@ebs1213 security]$ cd $FMW_HOME/user_projects/domains/EBS_domain_FIN2DB/servers/AdminServer/security
[applmgr@ebs1213 security]$ cat boot.properties
username={AES}LY9AdjI1A7wTpNJpOl4/aMIH3uc0HEwLVcbM9kXwffE=
password={AES}Gp7Q+3yqpimz1+27+ftmbCRHpgkMTpEZc67RsxM9XS0=

Thursday, 3 August 2017

Troubleshooting HTTP and HTTPS Traffic With WFetch

Troubleshooting HTTP and HTTPS Traffic With WFetch

This little utility has helped us out on numerous occasions when we were trying to figure out if a system was compromised,
proxy settings were wrong, proxy server not responding, or browsers were just plain not working.


WFetch 1.4 (Microsoft download site)

The above screenshot shows a successful connection from the workstation to Bing’s site.
This is one utility that belongs in our Technician’s Thumb Drive (blog category).

Tuesday, 28 February 2017

Oracle Open Interface

What is Oracle open interfaces?

Open interfaces used to integrate Oracle Applications with the non-oracle systems.
such as
1. Import data from your custom applications or legacy systems.
2. Migrate the old custom application data to the Oracle applications.
3. Import data from the banks, partners, suppliers, customers etc.


What is conversion?

Conversion is a one time Interface to migrate data from legacy application to the Oracle


Inbound Interface
The Interface which transforms and loads the data into the Oracle Applications system is called inbound interface.


Outbound Interface
The Interface which extracts the data from the oracle Application system for the purpose of loading into the external system is called outbound interface.


Common approach to interface is
  1. Data would be extracted from the source machine and loaded into the custom table (stagging table) in Oracle apps database. Depending upon the complexity of the data Stagging table can be avoided.
  2. The extracted data is then transformed into a form which oracle can recognize and pushed into interface tables.
  3. Final step is load the data from interface table to base table of Oracle applications.
This whole process is called extract load and transformation (ETL).


Oracle provides Interface tables for data intensive applications like Invoice, receipts, journals etc and PL/SQL APIs for master data interfaces like people, items, suppliers etc.


Traditional approach used sql Loader to load the data and pl/sql program to validate and extract data.
Modern approach uses BPEL, ESB for online data interfaces and Oracle Data Integrator for data intensive batch processing.


Common Interface technologies
1. XML Gateway
2. SQL*Loader
3. DB Link
4. Java Concurrent Program
5. BPEL or ESB
6. Oracle Data Integrator or ODI
7. PL/SQL package for reading file or XML data
8. Oracle Advanced Queuing


Some Useful Links

1. Oracle Integration Repository - List of Oracle open interfaces
2. Technical reference Manual - Column level details of Interface tables, base tables and APIs
3. Technical reference Manual for different versions.