Community Menu

KBACE Login

Oracle E-Business Suite Blog

A short description about your blog

 

Context

More and more industries today are integrating and embracing Service Oriented Approach to do their business. During our recent rollout of one of such projects, we found ourselves in the same situation where the client was on EBS 11.5.10 and the vendor was offering web services as touch points for data handshake. Client additionally wanted to schedule this integration on daily basis.

We explored few options like CSV file sharing, DB links etc but none of them were feasible as vendor only offered web service. So should our client buy SOA Suite to integrate with vendor? Or else how will they call a web service?


Bridging the gap
The webservices are exposed to the external parties via a WSDL (Web Services Description Language). This WSDL is provided to the external partner. So the question now is how to use this WSDL from Oracle EBS?

From within EBS, we can call this web service via WSDL using Java or PL/SQL. In our case, we used a PL/SQL procedure to invoke the webservice as it suited the requirement better. To simply the actual business case, let us consider a simple scenario where a supplier responds back with the Inventory Quantity when presented with a Item Code. If the web service exposed by the supplier is called InvQty, the PL/SQL procedure to invoke this web service will be as follows:

CREATE OR REPLACE
PROCEDURE  CALL_INV_QTY_WS
IS

        soap_request varchar2(30000);
        soap_respond varchar2(30000);
        http_req utl_http.req;
        http_resp utl_http.resp;
        launch_url varchar2(240) ;

BEGIN

         soap_request:='<?xml version="1.0" encoding="UTF-8"?>

        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

        <soap:Header/>

        <soap:Body xmlns:ns1="http://xmlns.oracle.com/InvQty_jws/Project1/InvQty">

                <ns1:process><ns1:ItemCode>MS787</ns1:ItemCode></ns1:process>

        </soap:Body>

        </soap:Envelope>';

        http_req:= utl_http.begin_request('http://soabpm-vm:7001/soa-infra/services/default/Project1/InvQty_client_ep','POST','HTTP/1.1');
        utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
        utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
        utl_http.set_header(http_req, 'SOAPAction', 'process');
        utl_http.write_text(http_req, soap_request) ;
        http_resp:= utl_http.get_response(http_req) ;
        utl_http.read_text(http_resp, soap_respond) ;
        utl_http.end_response(http_resp) ;
        dbms_output.put_line(soap_respond);

EXCEPTION WHEN UTL_HTTP.end_of_body THEN

        utl_http.end_response(http_resp);

END;


This PL/SQL procedure thus embeds a SOAP (protocol for exchanging the structured information in the implementation of web service) call in the procedure's body. The web service is thus invoked via the procedure CALL_INV_QTY_WS.
Now with the basic code in place, we just need to schedule it!
Based on when the web service needs to be invoked, this procedure can be scheduled in any of the following ways:

1. System scripts such as .bat or .sh invoking with PL/SQL procedure
2. Using DBMS_JOB package
3. Oracle EBS Concurrent Program


Conclusion

While the above scenario is a simple use case, the other business scenarios may be more complex. With Oracle SOA Suite 11g, these complex scenarios can be handled with ease. Further, the transaction management, security and exception handling features in Oracle SOA Suite are capable of enhancing the message delivery and integrity. With a rich Fusion Middleware stack, Oracle completely addresses interaction both within and outside of the Oracle technologies and offers umpteen prebuilt adapter for FTP, Database, EBS, Message Queues etc.

 


E-Business Adaptor in BPEL

Posted by: Siddharth Gandhi in SOAEBS adaptorBPEL on

Siddharth Gandhi

While working on one of the clients assignment, we developed this simple proof-of-concept to illustrates how easy it is to integrate Oracle Applications with BPEL

The process flow

This BPEL service accepts user values from ADF web application and passes them to HR_EMPLOYEE_API.CREATE_EMPLOYEE API using BPEL Oracle Applications adaptor [and not by calling DB package surpassing Function Security]. The values returned by the API are displayed to the user.

BPEL process

The BPEL process utilizes iRep repository to browse all the available Oracle Apps services. In Release 12, the Oracle Integration Repository is shipped as part of the E-Business Suite. R11 instances can be patched to achieve the same.

Refer http://irep.oracle.com/ for details

Browsing iRep repository

Once BPEL process is ready, the next step was to integrate this with a web application which will invoke this BPEL process. To achieve the same, we created a simple data entry ADF page utilizing ADF Data Control component.

On successful creation of an employee record in EBS, user is shows the next page [This page essentially contains the values of OUT parameters from CREATE_EMPLOYEE API]

Note: This is a synchronous integration of a web application with EBS API using BPEL as a broker. The application can be configured to show or hide various values, accept default parameters or call any other EBS API


Google Charts

Posted by: Siddharth Gandhi in Untagged  on

Siddharth Gandhi
 
Have you ever desired using Charts without doing any installations, setting classpaths, copying jar files etc?
 
What if we have a database centric PL/SQL application and customer wish to see Charts without buying into Oracle Developer products? Or what about embedding charts in OAF pages without pushing .jar files and setting classpaths? And the list is endless from BI Pub reports to SSHR pages..
 
But then how easy can it get?
Can we generate a chart by just providing the URL?
Yes, we can now! Read on.
 
With Google Charts API you can build a URL that will dynamically create a chart for you.
 
Google Chart API URLs must be in the following format:
 
Parameters are separated using the ampersand character (&). You can specify as many parameters as you like, in any order. For example, the Chart API returns the following chart in response to the URL below:
 
Chart
 
http://chart.apis.google.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Hello|World
 
Where:
  • http://chart.apis.google.com/chart? is the Chart API's location.
  • & separates parameters.
  • chs=250x100 is the chart's size in pixels.
  • chd=t:60,40 is the chart's data.
  • cht=p3 is the chart's type.
  • chl=Hello|World is the chart's label.

You can include a Chart API image in an HTML document by embedding a URL within an tag. When the webpage is displayed in a browser, the Chart API renders the image within the page. For example, the following tag results in the same image as above:

<img src="http://chart.apis.google.com/chart?
chs=250x100
&chd=t:60,40
&cht=p3
&chl=Hello|World"
alt="Sample chart" />

When you embed a URL in an HTML <img> tag, take care to use the character entity reference &amp; in place of an ampersand (&).

There are many more types of charts available (Bars, Pie, Scatter etc)

To try it out, we took a simple requirement: Make a pie chart grouping all the employee by departments.

Lets create a simple anonymous block to illustrate the same. This PL/SQL block will get us a simple URL which we can copy/paste in browser and get a chart. Or better, use as an tag for a report!

Here's the PL/SQL block:

---------------------------------

DECLARE 
  chd  VARCHAR2(4000);
  chdl VARCHAR2(4000);
  chl  VARCHAR2(4000);
  CURSOR c IS
  SELECT  ROUND(cnt / SUM(cnt) OVER () * 100, 2) pct, cnt, dname
  FROM
  (
     SELECT department_name dname, COUNT(*) cnt
     FROM employees, departments
     WHERE employees.department_id= departments.department_id
     GROUP BY departments.department_name
  )
  WHERE cnt>1
  ORDER BY 3 DESC;
BEGIN
  FOR usage IN c
  LOOP
    IF chd IS NULL THEN
      chd  := usage.pct;
    ELSE
      chd := chd || ',' || usage.pct;
    END IF;
   
    IF chdl IS NULL THEN
      chdl  := usage.dname;
    ELSE
      chdl := chdl || '|' || usage.dname;
    END IF;
   
    IF chl IS NULL THEN
      chl  := usage.cnt;
    ELSE
      chl := chl || '|' || usage.cnt;
    END IF;
  END LOOP;
  dbms_output.put_line('http://chart.apis.google.com/chart?cht=p&chs=300x200&&chco=FF0000'
    || '&chtt=Employees per department'
    || '&chl=' || chl || '&chd=t:' || chd || '&chdl=' || chdl);
END;

---------------------------------

The generated URL is:

http://chart.apis.google.com/chart?cht=p&chs=300x200&&chco=FF0000&chtt=Employees per department&chl=45|34|6|2|5|6|3|2&chd=t:43.69,33.01,5.83,1.94,4.85,5.83,2.91,1.94&chdl=Shipping|Sales|Purchasing|Marketing|IT|Finance|Executive|Accounting

And the image generated by Google Chart API for this URL is:

Image

Isn't that easy? Try it!

Just replace the SQL with yours and ensure the cursor logic works for you. And you're done.


While validating few of our self service customisations after the R12.1 upgrade, we encountered a runtime error, java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OraclePreparedStatement from class... 

On little Googling and surfing around Metalink, we landed on Metalink note 335754.1 which stated the reason quite clearly.

"The Oracle Database 10g Release 2 (10.2) will be the last major release to offer the following feature/libraries: classes12.jar, oracle.jdbc.drivers.* and OracleConnectionCacheImpl. In other words these features/libraries will not be available in the next major database release"

With an upgrade to R12.1 tech stack, which includes Oracle Database 11.1.0.7 and JDK6, this was bound to happen.

The best fix to the issue at hand was to edit>recompile>deploy the Java source files after removing/altering the desupported JDBC code. And so we did!

For instance, the following import statement,
import oracle.jdbc.driver.*;

was replaced by 

import oracle.jdbc.*;

 


 

Wow! Even before Fusion/ADF tech stack hits the enterprise world, Oracle shared their vision with the new R12.1.1 release. This not only paves the way for future upgrades to Fusion by laying the technical foundation, but also offers many new and enhanced features. 

Some of the primary technology (ATG) changes are:

[Refer Doc ID 561580.1 on Metalink Oracle Support for detail documentation] 

  • ATG: New tech stack now includes Oracle Database 11.1.0.7, JDK6, Application Server(Java) 10.1.3.4, Application Server (Forms/Reports) 10.1.2.3 etc.
  • ATG_CONFIG: Various enhancements to AutoConfig tool like Search utility, Inventory Validation report etc and enhanced support for DMZ, load balancing etc
  • OAF: Record History- OAF now allows viewing WHO columns information
  • OAF: BI Publisher(erstwhile XML Publisher) Integration - A personalisable "Print" button for OAF pages.
  • OAF: Flexfield References enhanced support- Now, R12.1 gives similar functionality as Forms UI for referencing other fields as part of flexfields.
  • OAF: Bulk Attachments- Bulk upload and web services/API support for document attachments.
  • OAF: Middle tier Data sorting - Now supports sorting of table data in middle tier instead of database in order to improve performance
  • AOL: FNDLOAD now supports BLOB data
  • SOA: New functionality supporting SOA components for easier integration/monitoring.
  • Diagnostics Framework: Many functionality changes to Oracle Diagnostics. It’s a free-of-cost license product and useful for technical resources.
  • SES: Full text search capability on Oracle EBS data (both structures and unstructured) with many enhancements which includes Work Flow notifications, Business Objects etc
  • UMX: Who, What, Why, How (W3H) questions are now answered with 360 degree view of the Security system