Академический Документы
Профессиональный Документы
Культура Документы
http://www.anilaltunkan.com/oracle-
3/e-business-suite-oracle/oracle-ebs-
service-invocation-framework-
business-events-sif/
In this tutorial, I am going to invoke an external test web service with SIF.
7. Type WSDL url for the external web service and click to Next button. SIF is
going to parse WSDL and display available services, ports, operations in web
service.
11. Fill Owner Name and Owner Tag for your subscription. Java Rule
Function specifies invoking java function. You can extend this class and write
your own invoker if you need. Click to Apply button.
12. We need to create a second subscription in request event. This is need for
request errors and it is going to launch WFERROR workflow which will send a
notification about error details to the SYSADMIN. Click to the Create
Subscription button.
13. Choose Source Type as external since it is going to get the error for external
service. Choose Rule Data as Key. Click to the Next button.
5. Choose Rule Data as message and this action time will be Custom. Click to
the Next button.
6. You can process response in java or pl/sql. We are going to create a pl/sql
function which will fetch event data. Pl/sql function should have a pre-defined
skeleton. We will go into detail at next steps. Click to the Apply button.
At this point, defining events and subscription process is completed.
Workflow Java Deferred Agent Listener (This is for JMS queue. Messages are going
to be fetched from WF_JAVA_DEFERRED table)
TABLE: xxanil_service_response
We are going to use this table for insering response of web service.
xxanil_service_response
Oracle PL/SQL
6 event_key varchar2(80),
7 event_name varchar2(80),
8 response clob,
9 creation_date date
10 );
11
13
PROCEDURE: get_service_response
insert_service_reponse
Oracle PL/SQL
6 sysdate);
7 commit;
end;
FUNCTION: get_service_response
get_service_response
Oracle PL/SQL
3 p_subscription_guid in raw,
5 is
6 l_node varchar2(30);
7 l_version integer;
8 l_from varchar2(2000);
9 l_eventName varchar2(80);
10 l_eventkey varchar2(80);
11 l_paramlist wf_parameter_list_t;
12 l_eventData clob;
13 l_messageHandle varchar2(100);
14 begin
15 l_eventkey := p_event.GetEventKey();
16 l_eventName := p_event.getEventName();
17 l_paramList := p_event.getParameterList();
18 l_eventData := p_event.getEventData();
20 return 'SUCCESS';
21 end get_service_response;
22
If external service has security, then we need to pass wsse parameters in header
of the request. SIF does not allow us to modify wsse header in code. We need to
create a password key (not password) in database. To do this, we are going to
give an application, key name and password.
PASSWORD KEY
Oracle PL/SQL
declare
sysResp number;
appResp number;
2 declare
3 sysResp number;
4 appResp number;
10 begin
11
13 begin
16 from FND_RESPONSIBILITY
17 where RESPONSIBILITY_KEY = 'SYSTEM_ADMINISTRATOR';
19 exception
22 fnd_global.apps_initialize(0,20420,1);
23 end;
24
26 end;
27 /
28 commit;
29
We are going to raise request event in pl/sql with wf_event.raise api. We need to
specify some neccessary parameters.
Important Note: If your body and header xml requests using namespaces, you
must move them to body and header in a proper manner.
Variables
variables
Oracle PL/SQL
l_parameters w f_parame
l_request_body clob;
l_request_header clob;
l_event_key varchar2 (5
1
3 l_request_body clob;
4 l_request_header clob;
Adding Parameters
OCaml
w f_event.addparametertolist
p_name => 'WFBES
p_value => 'ANIL',
p_parameterlist => l_para
2 wf_event.addparametertolist (
6 );
8 wf_event.addparametertolist (
1
2 wf_event.addparametertolist (
1 p_name => 'WFBES_SOAP_PASSWORD_KEY',
3
p_value => 'ANIL_KEY',
1
4 p_parameterlist => l_parameters
1 );
5
1
6 wf_event.addparametertolist (
1
9
wf_event.addparametertolist (
2
0 p_name => 'WFBES_CALLBACK_AGENT',
2
3 l_request_header := '<xx:SOAHeader
xmlns:xx="http://xmlns.oracle.com/apps/xx/soaprovider/plsql/xx_test_servic
2 e/">
4
2 <xx:Responsibility>TR_PAYABLES_MANAGER</xx:Responsibility>
5
<xx:RespApplication>SQLAP</xx:RespApplication>
2
6 <xx:SecurityGroup>STANDARD</xx:SecurityGroup>
2 <xx:NLSLanguage>TURKISH</xx:NLSLanguage>
7
<xx:Org_Id/>
2
8 </xx:SOAHeader>';
2
9
wf_event.addparametertolist (
3
p_name => 'WFBES_INPUT_taicsheader',
0
p_value => l_request_header,
3
1 p_parameterlist => l_parameters
3 );
2
3
3 wf_event.addparametertolist (
3
7 wf_event.addparametertolist (
4
1
4
2
4
3
4
4
4
5
4
6
4
7
4
8
4
9
5
0
5
1
5
2
5
3
5
4
5
5
5
6
5
7
raise
Oracle PL/SQL
l_request_body := '<test:Inp
<test:PARAM
</test:InputParam
2 l_request_body := '<test:InputParameters
xmlns:test="http://xmlns.oracle.com/apps/xx/soaprovider/plsql/xx_test_servi
3 ce/test_function/">
4 <test:PARAM>123</test:PARAM>
5 </test:InputParameters>';
6
1 commit;
2
1
3
Complete code:
Raise
Oracle PL/SQL
declare
l_parameters w f_parame
l_request_body clob;
l_request_header clob;
2 declare
4 l_request_body clob;
5 l_request_header clob;
7 begin
8 wf_event.addparametertolist (
1
2 wf_event.addparametertolist (
1 p_name => 'WFBES_SOAP_PASSWORD_MOD',
3
p_value => 'SQLAP',
1
4 p_parameterlist => l_parameters
1 );
5
1
6 wf_event.addparametertolist (
1 );
9
2 wf_event.addparametertolist (
0
p_name => 'WFBES_CALLBACK_EVENT',
2
1 p_value => 'XX_TEST_EVENT_RESPONSE',
2 wf_event.addparametertolist (
4
p_name => 'WFBES_CALLBACK_AGENT',
2
p_value => 'WF_WS_JMS_IN',
5
p_parameterlist => l_parameters
2
6 );
2
7
l_request_header := '<xx:SOAHeader
2 xmlns:xx="http://xmlns.oracle.com/apps/xx/soaprovider/plsql/xx_test_servic
8 e/">
2
9 <xx:Responsibility>TR_PAYABLES_MANAGER</xx:Responsibility>
3 <xx:RespApplication>SQLAP</xx:RespApplication>
0
<xx:SecurityGroup>STANDARD</xx:SecurityGroup>
3
1 <xx:NLSLanguage>TURKISH</xx:NLSLanguage>
3 <xx:Org_Id/>
2
</xx:SOAHeader>';
3
3
3 wf_event.addparametertolist (
4
p_name => 'WFBES_INPUT_taicsheader',
3
5 p_value => l_request_header,
4
1
wf_event.addparametertolist (
4
p_name => 'WFBES_INPUT_tAICSHeader',
2
p_value => l_request_header,
4
3 p_parameterlist => l_parameters
4 );
4
4
5 l_request_body := '<test:InputParameters
xmlns:test="http://xmlns.oracle.com/apps/xx/soaprovider/plsql/xx_test_servi
4 ce/test_function/">
6
<test:PARAM>123</test:PARAM>
4
7 </test:InputParameters>';
4
8
wf_event.raise (p_event_name => 'XX_TEST_EVENT_REQUEST',
4
p_event_key => l_event_key,
9
p_event_data => l_request_body,
5
0 p_parameters => l_parameters,
5
4
5
5
5
6
5
7
5
8
5
9
6
0
6
1
6
2
6
3
6
4
6
5
6
6
6
7
6
8
6
9
7
0
7
1
7
2
7
3
7
4
7
5
7
6
https://blogs.oracle.com/ebusinesssuiteintegration/entry/invoking_web_service_fr
om_orac_1
https://blogs.oracle.com/ebusinesssuiteintegration/entry/r121_-
_invoking_web_service_fr
Tags: apps, business events, oracle, oracle apps, oracle ebs, sif, subscriptions,
web service invoke, WFBES_INPUT_header, WFBES_SOAP_PASSWORD_KEY