18 Getting Started with Oracle Mediator

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

This chapter includes the following sections:

18.1 Introduction to Oracle Mediator

Oracle Mediator provides a lightweight framework to mediate between various components within a composite application. 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, a 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 a Mediator component to consume a business event or to receive a service invocation. A Mediator component can evaluate routing rules, perform transformations, validate, and either invoke another service or raise another business event. You can use a Mediator 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, 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 19.2.2.9, "Access Headers for Filters and Assignments".

  • Synchronous and Asynchronous Interactions

    Oracle Mediator provides support for synchronous as well as asynchronous request response interaction. In a synchronous interaction, the client requests for 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 be used to perform some action, such as raise an event or start a process.

    For more information about synchronous and asynchronous interactions, see Section 19.2.2.3, "Handling Response Messages" and Chapter 22, "Understanding Message Exchange Patterns of a 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 Routing Rules panel.

    For more information about sequential and parallel routing of messages, see Section 19.2.2.2, "Specifying 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 19.2.2.7, "Creating 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 19.2.2.10, "Using Semantic Validation" and http://www.schematron.com/.

  • Java Callout

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

    For more information about Java callout, see Section 19.2.2.11, "Support for Java Callouts".

  • Event Handling

    An event is a message data sent as a result of 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 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 44, "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 19.2.3, "Creating 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 20, "Using Mediator Error Handling".

  • Mediator Echo Support

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

    For more information about Mediator echo support, see "To echo a service:".

  • 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 Mediator".

18.2 Overview of Mediator Editor Environment

You can create a Mediator component in the SOA Composite Application of Oracle JDeveloper and then configure it by using the Mediator Editor. To display the Mediator Editor, double-click the Mediator component in the SOA Composite Editor. For information about the SOA Composite Editor, see Chapter 4, "Introduction to the Functionality of the SOA Composite Editor".

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

Figure 18-1 Mediator Editor Window

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

Each section of the view shown in Figure 18-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 18-1 displays the Mediator files. Figure 18-2 shows the files that appear under the SOA Content folder when you create a Mediator in a SOA Composite application.

    Figure 18-2 Mediator Files in Application Navigator

    Description of Figure 18-2 follows
    Description of "Figure 18-2 Mediator Files in Application Navigator"

    As shown in Figure 18-2, a SOA Composite application consists of the following Mediator files:

    • Composite.xml: The file that describes the entire SOA composite application. For information about the composite.xml file, see Chapter 4, "Introduction to the Functionality of the SOA Composite Editor".

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

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

    • .wsdl: A Web Service Description File (WSDL) file specifies how other services call a Mediator. A WSDL file defines the input and output messages and operations of a Mediator.

  • Mediator Editor

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

    • Double-click a Mediator 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 a Mediator. Click Source at the bottom of the Design window shown in Figure 18-1 to view to source code. The code in the source view is immediately updated to reflect the changes in a Mediator.

    The following example shows a sample 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 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 18-1 to open the History window. Figure 18-3 shows the History view for a Mediator file.

    Figure 18-3 History Window

    Description of Figure 18-3 follows
    Description of "Figure 18-3 History Window"

  • Property Inspector

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

  • Structure Window

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

  • Log Window

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

18.3 Creating a Mediator

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

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

18.3.1 Creating a Mediator Without Interface Definition

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

18.3.1.1 How to Create a Mediator with No Interface Definition

You can create a Mediator with no interface definition by using the Define Interface Later template in the Create Mediator dialog.

To create a Mediator with no interface definition:

  1. Drag a Mediator 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 Mediator component.

  3. In the Template list, select Define Interface Later as shown in Figure 18-7 and click OK.

    Figure 18-7 Define Interface Later Template Selection in Create Mediator Dialog

    Description of Figure 18-7 follows
    Description of "Figure 18-7 Define Interface Later Template Selection in Create Mediator Dialog"

18.3.1.2 How to Define an Interface for a Mediator with no Interface Definition

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

How to Subscribe to Events

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

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

    The Mediator Editor is displayed.

  2. Click Add Event Subscription in the Routing Rules section.

    The Subscribed Events dialog is displayed.

  3. Click Add.

    The Event Chooser dialog is displayed.

  4. Click Search to the right of the Event definition field 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 will see $publisher as the default security role. You can either retain this value or you can 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 Consistency, Run as Roles, and Filter fields of an event, see Section 18.3.6, "Creating a Mediator Component for Event Subscription".

How to Define Services

You can define service for a Mediator with no interface definition in following two ways:

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

  • By using the Define Service option in Mediator Editor.

To define services for a Mediator through wire:

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

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

    Note:

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

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

    Figure 18-8 Connecting Mediator to a Service

    Description of Figure 18-8 follows
    Description of "Figure 18-8 Connecting Mediator to a Service"

    When you double-click the Mediator, the Mediator Editor shown in Figure 18-9 is displayed.

    Figure 18-9 Mediator Editor

    Description of Figure 18-9 follows
    Description of "Figure 18-9 Mediator Editor"

To define services for a Mediator in Mediator Editor:

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

    The Mediator Editor is displayed.

  2. Click Add to the right of WSDL File.

    The Define Service dialog is displayed, as shown in Figure 18-10.

    Figure 18-10 Define Service Dialog

    Description of Figure 18-10 follows
    Description of "Figure 18-10 Define Service Dialog"

  3. 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 18.4, "Generating a WSDL File".

  4. In the Port type list, select a port.

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

  6. Click OK.

18.3.2 Creating a Mediator Based on a WSDL File

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

18.3.2.1 How to Create a Mediator Based on a WSDL File

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

To create a Mediator based on a WSDL File Interface:

  1. Drag a Mediator 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 Mediator component.

  3. In the Template list, select Interface Definition From WSDL as shown in Figure 18-11.

    Figure 18-11 Interface Definition from WSDL Template Selection in Create Mediator Dialog

    Description of Figure 18-11 follows
    Description of "Figure 18-11 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 are automatically connected to your Mediator.

  5. In the WSDL File 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 18.4, "Generating a WSDL File".

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

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

  8. Click OK.

18.3.3 Creating a Mediator with One-Way Interface Definition

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

18.3.3.1 How to Create a Mediator with One-Way Interface Definition

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

To create a Mediator with one-way interface definition:

  1. Drag a Mediator 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 Mediator component.

  3. In the Template list, select One-Way Interface as shown in Figure 18-12.

    Figure 18-12 One-Way Interface Template Selection in Create Mediator Dialog

    Description of Figure 18-12 follows
    Description of "Figure 18-12 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 are automatically connected to your Mediator component.

  5. Click Search to the right of the Input field to select a schema element for the input message. By default, 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 Mediator will process. 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.

18.3.3.2 What Happens When You Create a Mediator Component with One-Way Interface Definition

A Mediator for one-way interaction with port type defined for the input message is created. Figure 18-13 shows how a Mediator created with one-way interface looks like in Mediator Editor. The arrows to the left of the execute operation in Figure 18-15 represent a one-way operation.

Figure 18-13 One-Way Interface Mediator in Mediator Editor

Description of Figure 18-13 follows
Description of "Figure 18-13 One-Way Interface Mediator in Mediator Editor"

18.3.4 Creating a Mediator with Synchronous Interface Definition

A Mediator supports 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.

18.3.4.1 How to Create a Mediator with Synchronous Interface Definition

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

To create a Mediator with synchronous interface definition:

  1. Drag a Mediator 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 Mediator.

  3. In the Template list, select Synchronous Interface as shown in Figure 18-14.

    Figure 18-14 Synchronous Interface Template Selection in Create Mediator Dialog

    Description of Figure 18-14 follows
    Description of "Figure 18-14 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 are automatically connected to your Mediator.

  5. Click Search to the right of the Input field to select a schema element for the input message. By default, 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.

18.3.4.2 What Happens When You Create a Mediator Component with Synchronous Interface Definition

A Mediator with port type defined for the request message is created. In a synchronous interaction, because the response is sent to the same port as request, only one port is defined. Figure 18-15 shows how a Mediator created with synchronous interface appears in Mediator Editor. The arrows to the left of the execute operation in Figure 18-15 represent a synchronous operation.

Figure 18-15 Synchronous Mediator Component in Mediator Editor

Description of Figure 18-15 follows
Description of "Figure 18-15 Synchronous Mediator Component in Mediator Editor"

18.3.5 Creating a Mediator with Asynchronous Interface Definition

A Mediator supports 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.

18.3.5.1 How to Create a Mediator with Asynchronous Interface Definition

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

To create a Mediator with asynchronous interface definition:

  1. Drag a Mediator 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 Mediator.

  3. In the Template list, select Asynchronous Interface as shown in Figure 18-16.

    Figure 18-16 Asynchronous Interface Template Selection in Create Mediator Dialog

    Description of Figure 18-16 follows
    Description of "Figure 18-16 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 are automatically connected to your Mediator component.

  5. Click Search to the right of the Input field to select a schema element for the input message. By default, 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, singleString schema element is selected for the output message.

  7. Click OK.

18.3.5.2 What Happens When You Create a Mediator Component with Asynchronous Interface Definition

A Mediator for asynchronous interaction, with port types defined for request and response messages, is created. Figure 18-17 shows how a Mediator created with asynchronous interface looks like in Mediator Editor. The Port Type field displays the port on which the request message is sent. The Callback Port Type displays the port to which the response is sent. The arrows to the left of the execute operation in Figure 18-17 represent an asynchronous operation.

Figure 18-17 Asynchronous Mediator in Mediator Editor

Description of Figure 18-17 follows
Description of "Figure 18-17 Asynchronous Mediator in Mediator Editor"

18.3.6 Creating a Mediator Component for Event Subscription

You can create a 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 44, "Using Business Events and the Event Delivery Network".

18.3.6.1 How to Create a Mediator for Event Subscription

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

To create a Mediator for subscribing to events:

  1. Drag a Mediator 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 Mediator component.

  3. In the Template list, select Subscribe to Events as shown in Figure 18-18.

    Figure 18-18 Subscribe to Events Template Selection in Create Mediator Dialog

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

  4. Click Add.

    The Event Chooser dialog is displayed.

  5. Click Search to the right of the Event Definition field.

    The SCA 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 44, "Using Business Events and the Event Delivery Network".

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

    Figure 18-19 Event Chooser Dialog

    Description of Figure 18-19 follows
    Description of "Figure 18-19 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, 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 18-20 shows a sample Expression Builder dialog.

    Figure 18-20 Business Event Filter

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

    The Filter column of the Create Mediator dialog is populated as shown in Figure 18-21.

    Figure 18-21 Create Mediator Dialog with Filter Expression

    Description of Figure 18-21 follows
    Description of "Figure 18-21 Create Mediator Dialog with Filter Expression"

  12. Click OK.

18.3.6.2 What Happens When You Create a Mediator Component for Event Subscription

A Mediator similar to the one shown in Figure 18-22 is created. The icon on the left side of the Mediator indicates that this Mediator is configured for an event subscription.

Figure 18-22 Mediator Component Created with Subscribe to Events Template

Description of Figure 18-22 follows
Description of "Figure 18-22 Mediator Component Created with Subscribe to Events Template"

When you double-click the Mediator, the Mediator Editor shown in Figure 18-23 is displayed.

Figure 18-23 Mediator Component with Event Subscriptions in Mediator Editor

Description of Figure 18-23 follows
Description of "Figure 18-23 Mediator Component with Event Subscriptions in Mediator Editor"

18.3.7 What You May Need to Know About the Information Available in Mediator User Interface

This section describes the concepts you should know for creating a Mediator component.

18.3.7.1 Mediator Definition

Mediator is a component of Oracle SOA offering that provides mediation capabilities like selective routing, transformation and validation capabilities, along with various message exchange patterns, like synchronous, asynchronous and event publishing or subscription.

For more information about creating a Mediator, see Section 18.3, "Creating a Mediator".

18.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 19.2, "Defining Routing Rules".

You must specify the following for creating a routing rule:

  • Operation or Event

    A 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 an external Java logic at various points in the execution of the Mediator.

  • Static Routing Rule

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

    Static routing rules involve specifying the following:

    • Request Handler

      This defines how Mediator should handle incoming requests.

    • Reply Handler

      This defines how the synchronous response from the called service should be handled by Mediator.

    • Fault Handler

      This defines how the named or declared faults from the called service should be handled by Mediator.

    • Callback Handler

      This defines how the asynchronous response/callback from the called service should be handled by Mediator.

    • Timeout Handler in Callback

      This defines for how much time Mediator should wait for the asynchronous response/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 will execute or not. This feature uses XPath Standards and enables selective execution of Mediator routing rule.

    • Semantic Validation

      This feature enables semantic validation of incoming requests, and also verifies the correctness of data. This feature uses 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 suite the called service.

  • Dynamic Routing Rule

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

Note:

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

18.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 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 a Mediator with no interface definition.

Each of these methods opens the Create WSDL dialog shown in Figure 18-24.

Figure 18-24 Create WSDL Dialog

Description of Figure 18-24 follows
Description of "Figure 18-24 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.

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 is displayed, containing a list of the schema files (XSD files).

    Figure 18-25 Type Chooser Dialog

    Description of Figure 18-25 follows
    Description of "Figure 18-25 Type Chooser Dialog"

  2. Expand the Project Schema Files and Project WSDL Files nodes to locate the schema that you want 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, 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 the response will be sent.

  12. Click OK.

Generating the WSDL File Based on a Sample File

You can generate a WSDL file from a file in a native file 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 Oracle Fusion Middleware User's Guide for Technology Adapters.

18.5 Specifying Operation or Event Subscription Properties

After creating a Mediator, you can use the Mediator Editor to specify the Validate Syntax (XSD) property of an operation or event subscription. You can select this option to validate the schemas of the inbound messages. By default, validate schema is set to false.

18.6 Modifying a Mediator Component

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

18.6.1 Modifying Operations

You can modify a 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 a Mediator:

  1. In Mediator Editor, click the Refresh Operations From WSDL icon (shown highlighted in Figure 18-26) to the right of the WSDL File field.

    Figure 18-26 The Refresh Operations From WSDL Icon

    Description of Figure 18-26 follows
    Description of "Figure 18-26 The Refresh Operations From WSDL Icon"

    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 that will be deleted or added. The Refresh will delete Mediator operation field lists all the operation that have been removed from the WSDL file. The Refresh will add Mediator operation field lists all the new operation that have been added in the WSDL file. Figure 18-27 displays a Refresh WSDL dialog.

    Figure 18-27 Refresh WSDL Dialog

    Description of Figure 18-27 follows
    Description of "Figure 18-27 Refresh WSDL Dialog"

  2. To specify a different WSDL file, click Find Existing WSDLs 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 as shown in Figure 18-28.

    Figure 18-28 Refresh WSDL Dialog with Updated Operations

    Description of Figure 18-28 follows
    Description of "Figure 18-28 Refresh WSDL Dialog with Updated Operations"

  3. Click OK.

  4. From the File menu, select Save All.

18.6.2 Modifying Event Subscriptions

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

To modify events subscription of a Mediator:

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

    The Subscribed Events dialog is displayed as shown in Figure 18-29.

    Figure 18-29 The Subscribed Events Dialog

    Description of Figure 18-29 follows
    Description of "Figure 18-29 The Subscribed Events Dialog"

  2. You can perform any of the following functions:

  3. Click OK.

  4. From the File menu, select Save All.