19 Getting Started with Oracle Mediator

This chapter provides an overview of Oracle Mediator and also describes how to create an Oracle Mediator service component.

This chapter includes the following sections:

19.1 Introduction to Oracle Mediator

Oracle Mediator provides a lightweight framework to mediate between various components within a composite application. Oracle Mediator converts data to facilitate communication between different interfaces exposed by different components, which are wired together to build a SOA composite application. For example, Oracle Mediator can accept data contained in a text file from an application or service, transform it to a format appropriate for updating a database that serves as a customer repository, and then route and deliver the data to that database.

Oracle Mediator facilitates integration between events and services, where service invocations and events can be mixed and matched. You can use an Oracle Mediator service component to consume a business event or receive a service invocation. An Oracle Mediator service component can evaluate routing rules, perform transformations, validate, and either invoke another service or raise another business event. You can use an Oracle Mediator service component to handle returned responses, callbacks, faults, and timeouts.

This section provides an overview of Oracle Mediator features:

  • Content-Based and Header-Based Routing

    Oracle Mediator provides support for setting rules based on message payload or message headers. You can select elements or attributes from the message payload or the message header and, based on the values, you can specify an action. For example, Oracle Mediator receives a file from an application or service containing data about new customers. Based on the country mentioned in the customer's address, you can route and deliver data to the database storing data for that particular country. Similarly, you can route a message based on the message header.

    For more information about access header-based routing, see Section 20.2.2.11, "How to Access Headers for Filters and Assignments."

  • Synchronous and Asynchronous Interactions

    Oracle Mediator provides support for synchronous and asynchronous request and response interactions. In a synchronous interaction, the client requests a service and then waits for a response to the request. In an asynchronous interaction, the client invokes the service, but does not wait for the response. You can specify a timeout period for an asynchronous interaction, which can perform some action, such as raise an event or start a process.

    For more information about synchronous and asynchronous interactions, see Section 20.2.2.4, "How to Handle Response Messages" and Chapter 24, "Understanding Message Exchange Patterns of an Oracle Mediator."

  • Sequential and Parallel Routing of Messages

    A routing rule execution type can be either parallel or sequential. You can configure the execution type from the Routing Rules section of the Mediator Editor.

    For more information about sequential and parallel routing of messages, see Section 20.2.2.3, "How to Specify Sequential or Parallel Execution."

  • Transformations

    Oracle Mediator supports data transformation from one XML schema to another. This feature enables data interchange among applications using different schemas. For example, you can transform a comma-delimited file to the database table structure.

    For more information about transformations, see Section 20.2.2.8, "How to Create Transformations."

  • Validations

    Oracle Mediator provides support for validating the incoming message payload by using a Schematron or an XSD file. You can specify Schematron files for each inbound message part and Oracle Mediator can execute Schematron file validations for those parts.

    For more information about validations, see Section 20.2.2.12, "How to Use Semantic Validation" and http://www.schematron.com/.

  • Java Callouts

    Oracle Mediator provides support for Java callouts. Java callouts enable the use of Java code, together with regular expressions.

    For more information about Java callouts, see Section 20.2.2.13, "How to Use Java Callouts."

  • Event Handling

    An event is message data sent because of an occurrence of an activity in a business environment. Oracle Mediator provides support for subscribing to business events or raising business events. You can subscribe to a business event that is raised when a situation of interest occurs. For example, you can subscribe to an event that is raised when a new customer is created and then use this event to start a business process such as sending a confirmation email. Similarly, you can raise business events when a situation of interest occurs. For example, raise a customer-created event after completing the customer creation process.

    For more information about event handling, see Chapter 39, "Using Business Events and the Event Delivery Network."

  • Dynamic Routing

    Dynamic routing separates the control logic, which determines the path taken by the process, from the execution of the process. You can create a dynamic routing rule from the Mediator Editor.

    For more information about dynamic routing, see Section 20.2.3, "How to Create Dynamic Routing Rules."

  • Error Handling

    Oracle Mediator supports both fault policy-based and manual error handling. A fault policy consists of conditions and actions. Conditions specify the action to be carried out for a particular error condition.

    For more information about error handling, see Chapter 22, "Using Oracle Mediator Error Handling."

  • Oracle Mediator Echo Support

    Oracle Mediator supports echoing source messages back to the initial caller after any transforms, validations, assignments, or sequencing operations are performed.

    For more information about Oracle Mediator echo support, see "To echo a service:" of Section 20.2.2.1, "How to Specify Oracle Mediator Services or Events."

  • Multiple Part Message Support

    Oracle Mediator supports messages consisting of multiple parts. Some Remote Procedure Call (RPC) web services contain multiple parts in the SOAP message.

    For more information about multiple part message support, see Chapter 21, "Working with Multiple Part Messages in Oracle Mediator."

19.2 Introduction to the Mediator Editor Environment

You can create an Oracle Mediator service component in a SOA composite application of Oracle JDeveloper and then configure it by using the Mediator Editor. To display the Mediator Editor, double-click the Oracle Mediator service component in the SOA Composite Editor. For information about the SOA Composite Editor, see Chapter 2, "Developing SOA Composite Applications with Oracle SOA Suite."

Figure 19-1 shows the Mediator Editor along with the Application Navigator, Structure, and Messages windows.

Figure 19-1 Mediator Editor Window

Description of Figure 19-1 follows
Description of "Figure 19-1 Mediator Editor Window"

Each section of the view shown in Figure 19-1 enables you to perform specific design and deployment tasks. The following list describes these sections and their functionality:

  • Application Navigator

    The Application Navigator shown in the upper left part of Figure 19-1 displays the Oracle Mediator files. These are the files that appear under the SOA Content folder when you create an Oracle Mediator in a SOA composite application.

    A SOA composite application consists of the following Oracle Mediator files:

    • composite.xml: The file that describes the entire SOA composite application. For information about the composite.xml file, see Chapter 2, "Developing SOA Composite Applications with Oracle SOA Suite."

    • .componentType: The.componentType file describes the services and references for a service component.

    • .mplan: The.mplan file contains Oracle Mediator metadata.

    • .wsdl: A Web Services Description Language (WSDL) file specifies how other services call an Oracle Mediator. A WSDL file defines the input and output messages and operations of an Oracle Mediator.

  • Mediator Editor

    The Mediator Editor, shown in the middle of Figure 19-1, provides a visual view of the Oracle Mediator that you have created. This view is displayed when you perform one of the following actions:

    • Double-click an Oracle Mediator icon in the SOA Composite Editor.

    • Double-click the.mplan file name in the Application Navigator.

  • Source View

    The Source view enables you to view the source code of an Oracle Mediator. Click Source at the bottom of the Mediator Editor shown in Figure 19-1 to view the source code. The code in Source view is immediately updated to reflect the changes in an Oracle Mediator.

    Example 19-1 shows sample Oracle Mediator source code:

    Example 19-1 Oracle Mediator Source Code

    <?xml version = '1.0' encoding = 'UTF-8'?>
    
    <!--Generated by Oracle SCA Modeler version 1.0 at [4/16/07 10:05 PM].-->
    
    <Mediator name="CustomerDataRouter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    xmlns="http://xmlns.oracle.com/sca/1.0/mediator"/>
    
  • History Window

    The History window enables you to perform tasks such as viewing the revision history of a file and viewing read-only and editable versions of a file side-by-side. Click History at the bottom of the Design window shown in Figure 19-1 to open the History window. Figure 19-2 shows the History view for an Oracle Mediator file.

    Figure 19-2 History Window

    Description of Figure 19-2 follows
    Description of "Figure 19-2 History Window"

  • Property Inspector

    The Property Inspector shown at the bottom of Figure 19-1 enables you to view details about Oracle Mediator properties.

  • Structure Window

    The Structure Window shown in the lower left part of Figure 19-1 provides a structural view of the data of an Oracle Mediator.

  • Log Window

    The Log Window displays messages about the status of validation and compilation.

19.3 Creating an Oracle Mediator

You can create an Oracle Mediator in a SOA composite application of Oracle JDeveloper by using one of the following methods:

Each method opens the Create Mediator dialog in which you specify the name for the Oracle Mediator and select a template. A template provides a basic set of default files with which you can begin designing your Oracle Mediator.

19.3.1 Creating an Oracle Mediator Without an Interface Definition

You can create an empty Oracle Mediator with no interface definition. This provides you with the flexibility to create the SOA components in the order you want. For example, you can create an Oracle Mediator first and then create a service or an event that starts the Oracle Mediator.

19.3.1.1 How to Create an Oracle Mediator Without an Interface Definition

You can create an Oracle Mediator with no interface definition by selecting the Define Interface Later template in the Create Mediator dialog.

To create an Oracle Mediator without an interface definition:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator service component.

  3. From the Template list, select Define Interface Later, as shown in Figure 19-6 and click OK.

    Figure 19-6 Define Interface Later Template Selection in Create Mediator Dialog

    Description of Figure 19-6 follows
    Description of "Figure 19-6 Define Interface Later Template Selection in Create Mediator Dialog"

19.3.1.2 How to Define an Interface for an Oracle Mediator Without an Interface Definition

You can define the interface of an Oracle Mediator with no interface definition by subscribing to events or by defining services.

To subscribe to events:

You can subscribe to events by selecting the events defined in a.edl file.

  1. Double-click the Oracle Mediator icon in the SOA Composite Editor.

    The Mediator Editor is displayed.

  2. In the Routing Rules section, click Add Event Subscription.

    The Subscribed Events dialog is displayed.

  3. Click Add.

    The Event Chooser dialog is displayed.

  4. To the right of the Event definition field, click Search and select an .edl file.

    The Event field is populated with the events defined in the .edl file.

  5. Select one or more events and click OK.

  6. In the Consistency list, select a level of delivery consistency for the event.

  7. In the Run as Roles field, you see $publisher as the default security role. You can either retain this value or leave this field blank.

  8. Double-click the Filter field to specify an expression for filtering the event.

  9. Click OK.

    For more information about the Consistency, Run as Roles, and Filter fields of an event, see Section 19.3.6, "Creating an Oracle Mediator for an Event Subscription."

To define services:

You can define service for an Oracle Mediator with no interface definition in the following two ways:

  • By connecting the Oracle Mediator to a service through a wire in the SOA Composite Editor.

  • By using the Define Service option in Mediator Editor.

To define services for an Oracle Mediator through a wire:

  • In the SOA Composite Editor, drag a wire from an Oracle Mediator to a service.

    For more information about wires and how to wire a service component to a service, see Section 2.5.1, "How to Wire a Service and a Service Component."

    Note:

    You can also connect an Oracle Mediator with a defined interface and defined reference to a service through a wire. However, to connect Oracle Mediator to a service, the interface of the Oracle Mediator and the service must match.

    The service for an Oracle Mediator is automatically defined by using the WSDL file from the wire source. For example, if you connect the ReadFile service shown in Figure 19-7 to the CustomerDataRouter Oracle Mediator, then the CustomerDataRouter Oracle Mediator automatically inherits the service definition of the ReadFile service.

    Figure 19-7 Connecting Oracle Mediator to a Service

    Description of Figure 19-7 follows
    Description of "Figure 19-7 Connecting Oracle Mediator to a Service"

To define services for an Oracle Mediator in the Mediator Editor:

  1. Double-click the Oracle Mediator icon in the SOA Composite Editor.

    The Mediator Editor is displayed.

  2. To the right of the WSDL URL field, click Define Service.

    The Define Service dialog is displayed, as shown in Figure 19-8.

    Figure 19-8 Define Service Dialog

    Description of Figure 19-8 follows
    Description of "Figure 19-8 Define Service Dialog"

  3. To the right of the WSDL URL field, click Find existing WSDLs to use an existing WSDL file or Generate WSDL from schema(s) to create a new WSDL file.

    For information about how to generate a WSDL file, see Section 19.4, "Generating a WSDL File."

  4. From the Port Type list, select a port.

  5. From the Callback Port Type list, select a port for the response message in an asynchronous interaction.

  6. Click OK.

19.3.2 Creating an Oracle Mediator Based on a WSDL File

You can create an Oracle Mediator based on an existing WSDL file. A WSDL file describes the interfaces of an Oracle Mediator, such as schemas and operations.

19.3.2.1 How to Create an Oracle Mediator Based on a WSDL File

You can create an Oracle Mediator based on a WSDL file by using the Interface Definition from WSDL template in the Create Mediator dialog.

To create an Oracle Mediator based on a WSDL file:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator service component.

  3. From the Template list, select Interface Definition from WSDL, as shown in Figure 19-9.

    Figure 19-9 Interface Definition from WSDL Template Selection in Create Mediator Dialog

    Description of Figure 19-9 follows
    Description of "Figure 19-9 Interface Definition from WSDL Template Selection in Create Mediator Dialog"

  4. Deselect the Create Composite Service with SOAP Bindings option if you do not want to create an exposed service with SOAP bindings that is automatically connected to your Oracle Mediator.

  5. In the WSDL URL field, enter the name of the WSDL file.

    You can either use an existing WSDL file or create a new WSDL file. Click Find existing WSDL files to use an existing WSDL file or Generate WSDL from schema(s) to create a new WSDL file.

    For more information about these options, refer to Section 19.4, "Generating a WSDL File."

  6. From the Port Type list, select a port. This parses the WSDL file that you specify in the WSDL URL field to display the list of port types.

  7. From the Callback Port Type list, select a callback port. A callback port is the one to which the response message is sent in an asynchronous communication.

  8. Click OK.

19.3.3 Creating an Oracle Mediator with a One-Way Interface Definition

An Oracle Mediator supports a one-way interaction. In a one-way interaction, the client sends a message to the service, and the service does not need to reply.

19.3.3.1 How to Create an Oracle Mediator with a One-Way Interface Definition

You can create an Oracle Mediator for a one-way interaction by using the One-Way Interface template in the Create Mediator dialog.

To create an Oracle Mediator with a one-way interface definition:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator service component.

  3. From the Template list, select One-Way Interface, as shown in Figure 19-10.

    Figure 19-10 One-Way Interface Template Selection in Create Mediator Dialog

    Description of Figure 19-10 follows
    Description of "Figure 19-10 One-Way Interface Template Selection in Create Mediator Dialog"

  4. Deselect the Create Composite Service with SOAP Bindings option if you do not want to create an exposed service with SOAP bindings that is automatically connected to your Oracle Mediator service component.

  5. To the right of the Input field, click Search to select a schema element for the input message. By default, the singleString schema element is selected for the input message.

    Note:

    You can use any XSD schema to specify the format of the input document that Oracle Mediator processes. For example, you can use the following schema:
    <xsd:schema attributeFormDefault="qualified"
                elementFormDefault="qualified"
                targetNamespace="http://samples.otn.com/helloworld"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns="http://samples.otn.com/helloworld">
             <include namespace="http://samples.otn.com/helloworld"
     schemaLocation="helloworld.xsd" />
             <xsd:element name="name1" type="xsd:string" />
             <xsd:element name="result1" type="xsd:string"/>
    </xsd:schema>
    
  6. Click OK.

    An Oracle Mediator for a one-way interaction with a port type defined for the input message is created.

19.3.3.2 What Happens When You Create an Oracle Mediator with a One-Way Interface Definition

Figure 19-11 shows how an Oracle Mediator created with a one-way interface appears in the Mediator Editor. The arrows to the left of the execute operation in Figure 19-13 represents a one-way operation.

Figure 19-11 One-Way Interface Oracle Mediator in Mediator Editor

Description of Figure 19-11 follows
Description of "Figure 19-11 One-Way Interface Oracle Mediator in Mediator Editor"

19.3.4 Creating an Oracle Mediator with a Synchronous Interface Definition

Oracle Mediator supports a synchronous request-response interaction. In a synchronous interaction, a client sends a request to a service and receives an immediate response. The client does not proceed further until the response arrives.

19.3.4.1 How to Create an Oracle Mediator with a Synchronous Interface Definition

You can create an Oracle Mediator for a synchronous interaction by using the Synchronous Interface template in the Create Mediator dialog.

To create an Oracle Mediator with a synchronous interface definition:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator.

  3. From the Template list, select Synchronous Interface, as shown in Figure 19-12.

    Figure 19-12 Synchronous Interface Template Selection in Create Mediator Dialog

    Description of Figure 19-12 follows
    Description of "Figure 19-12 Synchronous Interface Template Selection in Create Mediator Dialog"

  4. Deselect the Create Composite Service with SOAP Bindings option if you do not want to create an exposed service with SOAP bindings that is automatically connected to your Oracle Mediator.

  5. To the right of the Input field, click Search to select a schema element for the input message. By default, the singleString schema element is selected for the input message.

  6. Click Search to the right of the Output field to select a schema element for the output message. By default, the singleString schema element is selected for the output message.

  7. Click OK.

    An Oracle Mediator with a port type defined for the request message is created.

19.3.4.2 What Happens When You Create an Oracle Mediator with a Synchronous Interface Definition

In a synchronous interaction, because the response is sent to the same port as the request, only one port is defined. Figure 19-13 shows how an Oracle Mediator created with a synchronous interface appears in the Mediator Editor. The arrows to the left of the execute operation in Figure 19-13 represent a synchronous operation.

Figure 19-13 Synchronous Oracle Mediator Component in the Mediator Editor

Description of Figure 19-13 follows
Description of "Figure 19-13 Synchronous Oracle Mediator Component in the Mediator Editor"

19.3.5 Creating an Oracle Mediator with an Asynchronous Interface Definition

An Oracle Mediator supports an asynchronous request-response interaction. In an asynchronous interaction, a client sends a request to a service, but does not block and wait for a reply.

19.3.5.1 How to Create an Oracle Mediator with an Asynchronous Interface Definition

You can create an Oracle Mediator for asynchronous interaction by using the Asynchronous Interface template in the Create Mediator dialog.

To create an Oracle Mediator with an asynchronous interface definition:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator.

  3. From the Template list, select Asynchronous Interface, as shown in Figure 19-14.

    Figure 19-14 Asynchronous Interface Template Selection in Create Mediator Dialog

    Description of Figure 19-14 follows
    Description of "Figure 19-14 Asynchronous Interface Template Selection in Create Mediator Dialog"

  4. Deselect the Create Composite Service with SOAP Bindings option if you do not want to create an exposed service with SOAP bindings that is automatically connected to your Oracle Mediator service component.

  5. To the right of the Input field, click Search to select a schema element for the input message. By default, the singleString schema element is selected for the input message.

  6. To the right of the Output field, click Search to select a schema element for the output message. By default, the singleString schema element is selected for the output message.

  7. Click OK.

    An Oracle Mediator for an asynchronous interaction with port types defined for request and response messages is created.

19.3.5.2 What Happens When You Create an Oracle Mediator with an Asynchronous Interface Definition

Figure 19-15 shows how an Oracle Mediator created with an asynchronous interface appears in the Mediator Editor. The Port Type field displays the port on which the request message is sent. The Callback Port Type field displays the port to which the response is sent. The arrows to the left of the execute operation in Figure 19-15 represent an asynchronous operation.

Figure 19-15 Asynchronous Oracle Mediator in the Mediator Editor

Description of Figure 19-15 follows
Description of "Figure 19-15 Asynchronous Oracle Mediator in the Mediator Editor"

19.3.6 Creating an Oracle Mediator for an Event Subscription

You can create an Oracle Mediator for subscribing to a business event that is raised when a situation of interest occurs. A business event consists of message data sent as the result of an occurrence in a business environment. For information about business events, see Chapter 39, "Using Business Events and the Event Delivery Network."

19.3.6.1 How to Create an Oracle Mediator for an Event Subscription

You can create an Oracle Mediator for subscribing to events by using the Subscribe to Events template in the Create Mediator dialog.

To create an Oracle Mediator for an event subscription:

  1. Drag a Mediator service component from the SOA list of the Component Palette and drop it in the Components section of the SOA Composite Editor.

    The Create Mediator dialog is displayed.

  2. In the Name field, enter a name for the Oracle Mediator service component.

  3. From the Template list, select Subscribe to Events, as shown in Figure 19-16.

    Figure 19-16 Subscribe to Events Template Selection in Create Mediator Dialog

    Description of Figure 19-16 follows
    Description of "Figure 19-16 Subscribe to Events Template Selection in Create Mediator Dialog"

  4. Click Add.

    The Event Chooser dialog is displayed.

  5. To the right of the Event Definition field, click Search.

    The SOA Resource Browser dialog is displayed.

  6. Select an event definition file (.edl) and click OK.

    The Event field is populated with the events described in the.edl file that you selected. For more information about creating.edl files, see Chapter 39, "Using Business Events and the Event Delivery Network."

  7. Select one or more events in the Event field, as shown in Figure 19-17, and click OK.

    Figure 19-17 Event Chooser Dialog

    Description of Figure 19-17 follows
    Description of "Figure 19-17 Event Chooser Dialog"

  8. Select a level of delivery consistency for the event.

    • one and only one: A global (JTA) transaction is used for event delivery. If the event call fails, the transaction is rolled back and the call is retried a configurable number of times.

    • guaranteed: A local transaction is used to guarantee delivery. There are no retries upon failure.

    • immediate: Events are delivered on the same thread and on the same transaction as the caller.

  9. In the Run as Roles field, enter a security role under which an event subscription is run. By default, an event subscription runs under the security of the event publisher $publisher. You can either retain this value or leave this field blank.

  10. To filter the event, perform any of the following:

    • Double-click the Filter column of the selected event.

    • Select the event and then click the filter icon (first icon).

    The Expression Builder dialog is displayed.

  11. In the Expression field, enter an XPath expression and click OK.

    Figure 19-18 shows a sample Expression Builder dialog.

    Figure 19-18 Business Event Filter

    Description of Figure 19-18 follows
    Description of "Figure 19-18 Business Event Filter"

    The Filter column of the Create Mediator dialog is populated accordingly.

  12. Click OK.

    An Oracle Mediator similar to the one shown in Figure 19-19 is created.

19.3.6.2 What Happens When You Create an Oracle Mediator for an Event Subscription

The icon on the left side of the Oracle Mediator indicates that this Oracle Mediator is configured for an event subscription.

Figure 19-19 Oracle Mediator Component Created with the Subscribe to Events Template

Description of Figure 19-19 follows
Description of "Figure 19-19 Oracle Mediator Component Created with the Subscribe to Events Template"

When you double-click the Oracle Mediator, the Mediator Editor is displayed.

19.3.7 What You May Need to Know About the Information Available in the Mediator Editor

This section describes the concepts you should know for creating an Oracle Mediator service component.

19.3.7.1 Oracle Mediator Definition

Oracle Mediator is a service component of Oracle SOA Suite that provides mediation capabilities such as selective routing, transformation, and validation capabilities, along with various message exchange patterns, such as synchronous, asynchronous, and event publishing or subscriptions.

For more information about creating an Oracle Mediator, see Section 19.3, "Creating an Oracle Mediator."

19.3.7.2 Routing Rule

Routing rules are mediation logic or execution logic that you define to achieve the requisite mediation. For more information about defining routing rules, see Section 20.2, "Defining Routing Rules."

You must specify the following for creating a routing rule:

  • Operation or Event

    An Oracle Mediator routing rule can be triggered either by a service operation or an event subscription. The service operation can be synchronous, asynchronous, or one-way.

  • Java Callout

    Java callouts are used to perform external Java logic at various points in the execution of the Oracle Mediator.

  • Static Routing Rule

    An Oracle Mediator routing rule is statically defined and is not expected to change depending on the invocation context. In this case, the routing can be an echo, a routing to another service, or a publishing of an event.

    Static routing rules involve specifying the following:

    • Request Handler

      This defines how Oracle Mediator handles incoming requests.

    • Reply Handler

      This defines how the synchronous response from the called service is handled by Oracle Mediator.

    • Fault Handler

      This defines how the named or declared faults from the called service are handled by Oracle Mediator.

    • Callback Handler

      This defines how the asynchronous response and callback from the called service is handled by Oracle Mediator.

    • Timeout Handler in Callback

      This defines how long Oracle Mediator waits for the asynchronous response and callback before performing timeout handling for the particular asynchronous request.

    • Event Publishing and Service Invocation

      Event publishing and service invocation call other services or publish an event depending on the configuration of the handlers.

    • Sequential and Parallel Execution

      Each routing rule execution can be configured to be either sequential (that is, running in the same thread) or parallel (that is, running in different threads).

      Note:

      For synchronous service invocations, the routing rule should always be sequential.
    • Filter Expression

      This defines whether a particular routing rule executes. This feature uses XPath standards and enables selective execution of Oracle Mediator routing rules.

    • Semantic Validation

      This feature enables semantic validation of incoming requests, and also verifies the correctness of data. This feature uses the Schematron validation standard.

    • Transformation

      This feature enables transformation of incoming data to a format that is compliant with called services or published events. This feature is based on XSL transformation standards.

    • Assign

      This feature enables manipulation of headers and properties for a message to suit the called service.

  • Dynamic Routing Rule

    An Oracle Mediator routing rule that enables you to externalize the routing logic to an Oracle Rules Dictionary, which in turn enables dynamic modification of the routing logic in a routing rule. This feature depends on a decision service and Oracle Rules to obtain the routing logic at runtime.

Note:

Oracle recommends using a Unicode database with AL32UTF8 as the database character set for full globalization support in Oracle Mediator.

19.4 Generating a WSDL File

You can generate a WSDL file by using either of the following methods:

  • By using the Generate WSDL from Schema(s) option that is displayed when you select the Interface Definition from WSDL template in the Create Mediator dialog.

  • By using the Generate WSDL from Schema(s) option in the Define Service dialog that is displayed while defining services for an Oracle Mediator with no interface definition.

Each of these methods opens the Create WSDL dialog shown in Figure 19-20.

Figure 19-20 Create WSDL Dialog

Description of Figure 19-20 follows
Description of "Figure 19-20 Create WSDL Dialog"

The Create WSDL dialog consists of Request, Reply, Fault, and Callback tabs, which you can use to define the schema files for request, reply, fault, and callback messages. You can specify the same or different schema files for the request, response, fault, and callback messages. Minimally, you must specify the schema file for the request message. By default, the singleString.xsd file is selected for the request message.

You can generate the WSDL file for a message by using an XML schema definition (XSD) file or by using a sample file.

19.4.1 How to Generate a WSDL File

To generate a WSDL file from an XSD file:

  1. In the Request tab of the Create WSDL dialog, click Search to access the schema location.

    The Type Chooser dialog shown in Figure 19-21 is displayed, containing a list of the schema files (XSD files).

    Figure 19-21 Type Chooser Dialog

    Description of Figure 19-21 follows
    Description of "Figure 19-21 Type Chooser Dialog"

  2. Expand the Project Schema Files and Project WSDL Files nodes to locate the schema to use.

    You can also import a schema XSD file or WSDL file into a project by using the Import Schema File or Import WSDL icons in the upper right corner of the dialog, respectively.

    Note:

    If you want to use a schema XSD file that resides on your local file system, then ensure that the XSD file and any XSD files that it imports all reside in the Oracle JDeveloper project directory.

    After you specify a file, Oracle JDeveloper parses it to determine the defined schema elements and displays them in a list, from which you can make a selection.

  3. Select the root element of the XSD file and click OK.

  4. In the Operation Name field, enter the operation name. For example, executeQuery.

    Oracle JDeveloper converts the specified operation into an operation element in the WSDL file.

    Note:

    Spaces are not allowed in an operation name.
  5. In the Port Type Name field, enter the port name.

  6. In the Namespace field, enter a namespace or accept the current value.

    For example: http://oracle.com/esb/namespaces/Mediator

    The namespace that you specify is defined as the tns namespace in the WSDL file.

  7. In the Reply tab, if entering any information, click Search to access a schema and then select a schema element.

    The Reply tab enables you to specify the schema for a response message in synchronous communication.

  8. In the Fault tab, if entering any information, click Search to access a schema location and then select a schema element. You cannot specify a fault message schema, unless you also specify a response.

  9. In the Callback tab, if entering any information, click Search to access a schema and then select a schema element.

    The Callback tab enables you to specify the schema for a response message in asynchronous communication.

  10. In the Operation Name field, enter the operation name. For example, returnQuery.

  11. In the Port Type Name field, enter the port name to which to send the response.

  12. Click OK.

To generate the WSDL file based on a sample file:

You can generate a WSDL file from a file in a native format such as a comma-separated value (CSV) file, a fixed-length file, a document type definition (DTD) file, or a COBOL copybook file. You can use the Native Format Builder wizard to generate a WSDL file based on a sample file. The Native Format Builder wizard is displayed when you click Define Schema for Native Format in the Request, Response, Fault, and Callback tabs of the Create WSDL dialog. A WSDL file is generated after you complete the wizard.

For information about the Native Format Builder wizard, see the Oracle Fusion Middleware User's Guide for Technology Adapters.

19.5 Specifying Operation or Event Subscription Properties

After creating an Oracle Mediator, you can use the Mediator Editor to select the Validate Syntax (XSD) checkbox for an operation or event subscription. You can select this option to validate the schemas of the inbound messages. By default, this checkbox is not selected.

19.6 Modifying an Oracle Mediator Service Component

You can modify the operations or event subscriptions of an Oracle Mediator by using the Mediator Editor.

19.6.1 How To Modify Operations of an Oracle Mediator

You can modify an Oracle Mediator WSDL file by adding or deleting operations. After modifying the WSDL file, you can use the Refresh WSDL dialog to synchronize the changes.

To modify the operations of an Oracle Mediator:

  1. In the Mediator Editor, click the Refresh operations From WSDL icon to the right of the WSDL URL field.

    The Refresh WSDL dialog is displayed. If you have made any modifications to the WSDL file, then the Refresh WSDL dialog lists all the operations to delete or add. The Refresh will delete Mediator operation field lists all the operations that have been removed from the WSDL file. The Refresh will add Mediator operation field lists all the new operations that have been added in the WSDL file. Figure 19-22 displays the Refresh WSDL dialog.

    Figure 19-22 Refresh WSDL Dialog

    Description of Figure 19-22 follows
    Description of "Figure 19-22 Refresh WSDL Dialog"

  2. To specify a different WSDL file, click Find existing WSDLs to the right of the WSDL URL field to use an existing WSDL file or Generate WSDL From schema(s) to create a new WSDL file.

    The Refresh WSDL dialog is updated based on the operations defined in the specified WSDL file.

  3. Click OK.

  4. From the File menu, select Save All.

19.6.2 How To Modify Event Subscriptions of an Oracle Mediator

You can subscribe to new events, modify existing event subscriptions, and unsubscribe from subscribed events by using the Manage Event Subscriptions option in the Mediator Editor.

To modify event subscriptions of an Oracle Mediator:

  1. In the Mediator Editor, click the Manage Event Subscriptions icon to the right of Event Subscriptions.

    The Subscribed Events dialog is displayed, as shown in Figure 19-23.

    Figure 19-23 The Subscribed Events Dialog

    Description of Figure 19-23 follows
    Description of "Figure 19-23 The Subscribed Events Dialog"

  2. You can perform any of the following functions:

  3. Click OK.

  4. From the File menu, select Save All.