Integrating With Fusion Application Using Services (PLSQL: APEX_WEB_SERVICE)

Fusion Applications provides Web services that allow external systems to integrate with Fusion Applications. There are two types of services: ADF services and composite services. ADF services are created for a logical business object and provide functionality to access and manipulate these objects. The composite services are mostly process oriented and provide an orchestration of multiple steps. 

Information about the web services provided by Fusion Applications is hosted in Oracle Enterprise Repository (OER). The information provided by OER can be used to understand the functionality provided by the service and how the service can be called.

This series of articles describes how one can invoke SOAP web services provided by Fusion Applications using various technologies. In this article we will cover how to invoke a Fusion Application web service using PLSQL package APEX_WEB_SERVICE.

Prerequisites

The APEX_WEB_SERVICE can be used to call Web Services on a database where Application Express schema has been installed.

Implementing Web Service Call

Oracle Application Express (APEX) provides APEX_WEB_SERVICE API to call services from the database.  With APEX_WEB_SERVICE we are directly constructing and processing the XML for the SOAP:

 declare
  l_result XMLTYPE;
  l_envelope CLOB;
BEGIN
  -- Construct xml payload, which is used to invoke the service. In the example case it is a "hard coded" string.
  l_envelope := '<?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                     xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <soap:Body>
          <findRule xmlns="http://xmlns.oracle.com/apps/incentiveCompensation/cn/creditSetup/creditRule/creditRuleService/types/">
            <findCriteria>
              <fetchStart xmlns="http://xmlns.oracle.com/adf/svc/types/">0</fetchStart>
              <fetchSize xmlns="http://xmlns.oracle.com/adf/svc/types/">-1</fetchSize>
              <filter xmlns="http://xmlns.oracle.com/adf/svc/types/">
                <group>
                  <upperCaseCompare>false</upperCaseCompare>
                    <item>
                      <upperCaseCompare>false</upperCaseCompare>
                      <attribute>RuleId</attribute>
                      <operator>=</operator>
                      <value>300000000851162</value>
                    </item>
                  </group>
                </filter>
                <excludeAttribute xmlns="http://xmlns.oracle.com/adf/svc/types/">false</excludeAttribute>
            </findCriteria>
            <findControl>
              <retrieveAllTranslations xmlns="http://xmlns.oracle.com/adf/svc/types/">false</retrieveAllTranslations>
            </findControl>
          </findRule>
        </soap:Body>
      </soap:Envelope>';
  -- Call the web service
  l_result := apex_web_service.make_request(
    p_url               => 'https://host:port/icCnSetupCreditRulesPublicService/CreditRuleService?wsdl',
    p_action            => 'http://xmlns.oracle.com/apps/incentiveCompensation/cn/creditSetup/creditRule/creditRuleService/findRule',
    p_envelope          => l_envelope,
    p_username          => 'username',
    p_password          => 'password' );
  dbms_output.put_line(l_result.getClobVal());
END;

The above code does the following:

  1. Construct xml payload, which is used to invoke the service. In the example case it is a “hard coded” string to be passed to the request.
  2. Invoke the service using APEX_WEB_SERVICE API which in turn will use the UTL_HTTP
  3. Get the response and process it, in this example we simply print out the response

Summary

In this article we covered an example using APEX_WEB_SERVICE PLSQL package to integrate with Fusion Applications using web services. In future articles other technologies for invoking Fusion Applications web services will be covered.

References



Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow us on twitter Fusion Applications Extensibility, Customizations and Integration forum Fusion Applications Dev Relations YouTube Channel
This blog offers news, tips and information for developers building extensions, customizations and integrations for Oracle Fusion Applications.

Search

Categories
Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
4
5
6
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today