Print Page

Sunday, August 26, 2007

XMLGateway Integration

Most Prefferred way of integration of Oracle AS B2B to XMLGateway is throguh AQ i.e through a set of ECX_Inbound and ECX_outbound queues.

The following are the headers XMLG should set before it enqueues ino to ECX_OUTBOUND (like from, to, doc_type and doc_rev in case AQ),

MESSAGE_TYPE
MESSAGE_STANDARD
TRANSACTION_TYPE
TRANSACTION_SUBTYPE
DOCUMENT_NUMBER
PARTYID
PARTY_SITE_ID
PARTY_TYPE
PROTOCOL_TYPE
PROTOCOL_ADDRESS
USERNAME
PASSWORD
PAYLOAD
ATTRIBUTE1
ATTRIBUTE2
ATTRIBUTE3
ATTRIBUTE4
ATTRIBUTE5

among them TRANSACTION_TYPE ,TRANSACTION_SUBTYPE,PARTY_SITE_IDATTRIBUTE1 are mandatory. ECX* queue are not preseeded in B2B, instead they can be created by using the following script.

connect apps/apps

drop type ECXMSG;
/

create type ECXMSG as OBJECT (
MESSAGE_TYPE VARCHAR2(2000) ,
MESSAGE_STANDARD VARCHAR2(2000) ,
TRANSACTION_TYPE VARCHAR2(2000) ,
TRANSACTION_SUBTYPE VARCHAR2(2000) ,
DOCUMENT_NUMBER VARCHAR2(2000) ,
PARTYID VARCHAR2(2000) ,
PARTY_SITE_ID VARCHAR2(2000) ,
PARTY_TYPE VARCHAR2(2000) ,
PROTOCOL_TYPE VARCHAR2(2000) ,
PROTOCOL_ADDRESS VARCHAR2(2000) ,
USERNAME VARCHAR2(2000) ,
PASSWORD VARCHAR2(2000) ,
PAYLOAD CLOB ,
ATTRIBUTE1 VARCHAR2(2000) ,
ATTRIBUTE2 VARCHAR2(2000) ,
ATTRIBUTE3 VARCHAR2(2000) ,
ATTRIBUTE4 VARCHAR2(2000) ,
ATTRIBUTE5 VARCHAR2(2000)
);
/

begin
begin
dbms_aqadm.stop_queue('ECX_INBOUND');
exception when others then null; end;
begin
dbms_aqadm.stop_queue('ECX_OUTBOUND');
exception when others then null; end;
begin
dbms_aqadm.drop_queue('ECX_INBOUND');
exception when others then null; end;
begin
dbms_aqadm.drop_queue('ECX_OUTBOUND');
exception when others then null; end;
begin
dbms_aqadm.drop_queue_table('ECX_INQUEUE');
exception when others then null; end;
begin
dbms_aqadm.drop_queue_table('ECX_OUTQUEUE');
exception when others then null; end;
end;
/

declare
begin
dbms_aqadm.create_queue_table('ECX_INQUEUE','apps.ECXMSG',multiple_consumers=>FALSE);
dbms_aqadm.create_queue_table('ECX_OUTQUEUE','apps.ECXMSG',multiple_consumers=>FALSE);
dbms_aqadm.create_queue('ECX_INBOUND', 'ECX_INQUEUE');
dbms_aqadm.create_queue('ECX_OUTBOUND', 'ECX_OUTQUEUE');
dbms_aqadm.start_queue('ECX_INBOUND');
dbms_aqadm.start_queue('ECX_OUTBOUND');
end;
/

connect system/welcome1
grant execute on apps.ECXMSG to b2b
/

exit;

ENQUE SCRIPT :

The property values 'XML', 'OAG', 'POPI','POPI','1234','1234','1234' etc map to
MESSAGE_TYPE, MESSAGE_STANDARD, TRANSACTION_TYPE,
TRANSACTION_SUBTYPE, DOCUMENT_NUMBER ,
PARTYID,
PARTY_SITE_ID,
PARTY_TYPE,
PROTOCOL_TYPE



>>>>>>>>>>
create sequence poid_counter;

-- replace the TERMID 10193 with OM2N

CREATE OR REPLACE PROCEDURE enqueue_oag_message
IS
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
msgid RAW(16);
xmlgin SYSTEM.ECXMSG;
xmlgout SYSTEM.ECXMSG;
agent_in sys.aq$_agent;
agent_out sys.aq$_agent;
xml_payload varchar2(30000);
poid number(10);
BEGIN
select poid_counter.nextval into poid from dual;
xml_payload := ''||
''||
'John Smith'||
''||
'Ola Nordmann'||
'

Langgt 23
'||
'4000 Stavanger'||
'Norway'||
''||
''||
'Empire Burlesque'||
'Special Edition'||
'1'||
'10.90'||
'
'||
''||
'Hide your heart'||
'1'||
'9.90'||
'
'||
''
;
/*message_properties.Correlation := 'WEBLOGIC';*/
message_properties.Correlation := 'ORACLE-AS-B2B';
/*msgid:='ORACLE-AS-B2B';*/

xmlgout := SYSTEM.ECXMSG('XML', 'OAG', 'POPI','POPI','1234','1234','1234',
'S', 'B2B', 'http://ap100jvm.us.oracle.com:8003/oa_servlets/oracle.apps.ecx.oxta.TransportAgentServer', 'saiqa', 'chowdry', xml_payload,
null, null, null, null, null);

dbms_aq.enqueue(queue_name => 'ECX_OUTBOUND',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => xmlgout,
msgid => msgid);
commit;
END;
/

Ensure to configure the ECX_OUTBOUND/ECX_INBOUND Internal delivery channel in B2B with appropriate IP address and SID.

No comments: