Invoke_Record_Impersonate¶
Invokes an operation in the application server impersonating a user.
PROCEDURE Invoke_Record_Impersonate (
interface_ IN type_interface_,
method_ IN type_method_,
record_ IN OUT type_record_,
run_as_identity_ IN VARCHAR2 DEFAULT NULL,
connection_string_ IN type_connection_string_ DEFAULT NULL,
activity_ IN BOOLEAN DEFAULT FALSE,
timeout_ IN NUMBER DEFAULT NULL );
PROCEDURE Invoke_Record_Impersonate (
interface_ IN type_interface_,
method_ IN type_method_,
document_ IN OUT Plsqlap_Document_API.Document,
run_as_identity_ IN VARCHAR2 DEFAULT NULL,
connection_string_ IN type_connection_string_ DEFAULT NULL,
activity_ IN BOOLEAN DEFAULT FALSE,
timeout_ IN NUMBER DEFAULT NULL );
PROCEDURE Invoke_Record_Impersonate (
interface_ IN type_interface_,
method_ IN type_method_,
xml_ IN OUT CLOB,
run_as_identity_ IN VARCHAR2 DEFAULT NULL,
connection_string_ IN type_connection_string_ DEFAULT NULL,
activity_ IN BOOLEAN DEFAULT FALSE,
timeout_ IN NUMBER DEFAULT NULL );
Parameters¶
interface_
Name of interface containing the requested operation.
method_
Name of requested operation.
record_
Input/Output record that corresponds to the interface view definition. This record will automatically be converted to XML and attached as a binary body to the message before it is sent.
document_
Input/Output document that corresponds to the interface view definition. This document will automatically be converted to XML and attached as a binary body to the message before it is sent. This is recommended to use version of procedure taking Document as parameter instead of Record.
xml_
An XML document that corresponds to the interface view definition. The XML is attached as a binary body to the message before it is sent.
run_as_identity_
A Foundation1 user directory id. If no user is supplied the session user is used.
connection_string_
Optional connection string to an application server. If no connection string is supplied the call will be to the application server set in the configuration (Set_Plsqlap_Environment).
activity_
If TRUE the call will be done to the Main Server rather then the Integration Server. Default FALSE.
timeout_
Optional timeout in seconds.
Example¶
DECLARE
doc_ PLSQLAP_Document_API.Document;
id_ PLSQLAP_Document_API.Element_Id;
date_ DATE := to_date('2014-10-15 14:44','YYYY-MM-DD HH24:MI');
resp_ CLOB;
BEGIN
-- Prepare input data
doc_ := PLSQLAP_Document_API.New_Document('TEST_ORDER');
PLSQLAP_Document_API.Add_Attribute(doc_, 'COMMENTS', 'Outbound Sync Impersonate as ALAIN - GetTestOrder');
PLSQLAP_Document_API.Add_Attribute(doc_, 'COMPANY', '01');
PLSQLAP_Document_API.Add_Attribute(doc_, 'DELIVERY_DATE', date_, type_ => PLSQLAP_Document_API.TYPE_TIMESTAMP);
PLSQLAP_Document_API.Add_Attribute(doc_, 'CUSTOMER_ID', test_id_);
id_ := PLSQLAP_Document_API.Add_Array(doc_, 'ORDER_LINES');
id_ := PLSQLAP_Document_API.Add_Document(doc_, 'TEST_ORDER_ITEM', id_);
PLSQLAP_Document_API.Add_Attribute(doc_, 'AMOUNT', 12324344, id_, PLSQLAP_Document_API.TYPE_FLOAT);
PLSQLAP_Document_API.Add_Attribute(doc_, 'PRICE', 812324344, id_, PLSQLAP_Document_API.TYPE_FLOAT);
PLSQLAP_Document_API.Add_Attribute(doc_, 'DESCRIPTION', 'Hello All', id_);
PLSQLAP_Document_API.Add_Attribute(doc_, 'PRODUCT_NO', 'A144522', id_);
-- Invoke interface
PLSQLAP_Server_API.Invoke_Record_Impersonate('TestOrderInteraction', 'GetTestOrder', doc_, 'ALAIN');
END;