Securing Oracle B2B Web Services

Scripts for Archiving and Restoring Data 21-3

21.3 Restoring B2B Business Messages

To restore business messages, set up the import directory and permissions and then run the restore procedure. To set up the import directory and permissions: 1. On the PC running the database, create a directory for the import file. mkdir tmpimport 2. Give permissions to this directory so that the database process can read from it. chmod 777 tmpimport 3. Log in to the database as sysdba. sqlplus as sysdba 4. Set up B2B_IMPORT_DIR. SQL create or replace B2B_IMPORT_DIR as tmpimport 5. Grant the SOA schema user b2b_soainfra permission for the export. SQL grant read, write on directory B2B_IMPORT_DIR to b2b_soainfra; SQL grant imp_full_database to b2b_soainfra; To restore business messages: Set up the import directory and permissions before using the following PLSQL API. 1. Log in as the SOA infra schema user. sqlplus soa_infra_userpassword 2. Execute the import procedure, for example SQL exec b2b_restore_procedureJAN.dmp; The signature of the procedure is b2b_restore_procedurefileName Use the Reports tab to search for and display the imported data. 21-4 Oracle Fusion Middleware Users Guide for Oracle B2B 22 Utilities for Enqueuing and Dequeuing 22-1 22 Utilities for Enqueuing and Dequeuing Oracle B2B provides utilities to test and verify your installation and configuration before connecting to the host back-end applications. Use the utilities to learn how to send and receive business messages to and from Oracle B2B through the default AQ queue interface or the JMS queue interface. Other AQ internal delivery channels can be handled in the same way. See the B2B samples for examples of how to implement these utilities See Section 1.7, Oracle B2B Samples and Cookbooks, for information about the samples. This chapter contains the following topics: ■ Section 22.1, AQ Enqueue and Dequeue Utilities ■ Section 22.2, JMS Enqueue and Dequeue Utilities ■ Section 22.3, Using the attachmentsDescriptor.xsd

22.1 AQ Enqueue and Dequeue Utilities

You can enqueue to and dequeue from an AQ queue using Java. IPEnqueue and IPDequeue must be executed in the Oracle B2B environment.

22.1.1 AQ Enqueue

Table 22–1 lists the Java AQ enqueue utility oracle.tip.b2b.data.IPEnqueue properties. Table 22–1 IPEnqueue Properties Name Description queue The outbound AQ queue name. If unspecified, the Java enqueue utility uses the default outbound queue IP_OUT_QUEUE. replyToMsgID The message ID to which the sending message is replying, typically used for the response message type. from Trading partner that sends the message to Trading partner that receives the message doctypeName Document type name for the message doctypeRevision Document protocol revision for the message payload Payload file name 22-2 Oracle Fusion Middleware Users Guide for Oracle B2B Example: ipenqueue.properties queue = url = jdbc:oracle:thin:host:1521:sid user = user1 password = password replyToMsgID = from = Acme to = GlobalChips doctypeName = 850 doctypeRevision = 4010 payload = Acme_850.xml attachment =

22.1.2 AQ Dequeue

To dequeue messages, use the IPDequeue utility. ATTACHMENT_NA ME Attachment file name. Use this property to assign a name to the attachment file that is something other than the e-mail subject name. For a custom outbound message over e-mail with AQ, do the following: actionName=ATTACHMENT_NAME:Sample.txt url The database URL format is jdbc:oracle:thin:host:port:sid user The database user password The database password eventName Action name msgID Message ID optional. B2B generates its own message ID if it is not provided as part of an enqueue. msgType Provide an optional message type: ■ Request = 1 default ■ Response = 2 ■ Functional Ack = 9 dateFormat Used to convert the date format used in e-mail delivery channel DYNAMICEMAIL Provides the to party e-mail address as part of actionName. For example: actionName=DYNAMICEMAIL:email_id DYNAMIC_FROM_E MAIL Provides the from party e-mail address as part of actionName. For example: actionName=DYNAMIC_FROM_EMAIL:email_id Note: In Windows ja_JP locale instances, the VARCHARString values are not enqueued correctly to the queue. The INT and CLOB values are enqueued correctly. This causes some fields, such as the from and to fields, to be null when the IPEnqueue utility is used to enqueue a file. As a workaround, in ja_JP locales, orai18n.jar should be added to the classpath while using oracle.tip.b2b.data.IPEnqueue. Table 22–1 Cont. IPEnqueue Properties Name Description