Skip Headers
Oracle® Fusion Middleware Developer's Guide for Oracle SOA Suite
11g Release 1 (11.1.1.6.3)

Part Number E10224-15
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

19 Getting Started with Oracle Mediator

This chapter describes Oracle Mediator, which provides transformation, validation, and routing logic to Oracle SOA Suite applications. This chapter also describes how to create a Mediator component and the associated WSDL documents in Oracle JDeveloper.

This chapter includes the following sections:

19.1 Introduction to Oracle Mediator

Oracle Mediator is a service component of the 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.

Mediator provides a lightweight framework to mediate between various components within a composite application, such as business processes, human workflows, and so on, using a Web Services Description Language (WSDL) document as the interface. Mediator converts data to facilitate communication between different interfaces exposed by different components that are wired to build a SOA composite application. For example, Mediator can accept data contained in a text file from an application or service, transform it into a format appropriate for updating a database that serves as a customer repository, and then route and deliver the data to that database.

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

19.2 Mediator Functionality

The following sections describe the primary functions that Oracle Mediator supplies to an Oracle SOA Suite application.

19.2.1 Content-Based and Header-Based Routing

Mediator enables you to define rules based on the message payload or message headers. You can select elements or attributes from the message payload or the message header and, based on the values in those elements or attributes, 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 header-based routing, see Section 20.3.2.12, "How to Access Headers for Filters and Assignments."

19.2.2 Synchronous and Asynchronous Interactions

Mediator supports both 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 and you can specify an action to perform after the timeout period, such as to raise an event or start a process.

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

19.2.3 Sequential and Parallel Routing of Messages

Mediator lets you specify that a routing rule be executed either in parallel or in sequence. 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.3.2.3, "How to Specify Sequential or Parallel Execution."

19.2.4 Message Resequencing

When you use the Mediator resequencer, it rearranges streams of related but out-of-sequence messages into their sequential order based on the type of resequencer used and the rules you define. When incoming messages arrive in a random order, the resequencer orders the messages based on sequential or chronological information, and then sends the messages to the target services in the correct order based on the resequencing configuration.

For more information about resequencing messages, see Chapter 23, "Resequencing in Oracle Mediator."

19.2.5 Data Transformation

Mediator lets you define 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 a database table structure.

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

19.2.6 Payload Validation

You can configure Mediators to validate the incoming message payload using a Schematron or an XSD file. You can specify Schematron files for each inbound message part and Mediator executes Schematron file validations for those parts.

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

19.2.7 Java Callouts

Mediator lets you add Java callouts to the routing rules. Java callouts are a way of using of Java code with regular expressions.

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

19.2.8 Event Handling

An event is a message sent because an activity occurred in a business environment. Mediator can both subscribe to and raise business events. You can subscribe to a business event that is generated when a situation of interest occurs. For example, you can subscribe to an event that is generated 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 generate business events when a situation of interest occurs. For example, after a new customer profile is created, you can generate a customer-created event.

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

19.2.9 Dynamic Routing

Dynamic routing separates the control logic of a process from the execution of the process. The control logic determines the path taken by the process. You can create dynamic routing rules using the Mediator Editor.

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

19.2.10 Error Handling

Mediator supports both manual error handling and error handling based on fault policies. A fault policy consists of conditions and actions, where the 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."

19.2.11 Sending Messages Back to the Caller (Echo)

Mediator can echo source messages back to the initial caller after any transformations, validations, assignments, or sequencing operations are performed.

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

19.2.12 Multiple Part Messages

Mediator can process messages that consist 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.3 Introduction to the Mediator Editor Environment

You can create a Mediator service component in a SOA composite application of Oracle JDeveloper and then configure it using the Mediator Editor. To display the Mediator Editor, double-click the 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.

Note:

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

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 lets you perform specific design and deployment tasks. The sections in this view include the following:

19.4 Creating a Mediator

You can create a Mediator in multiple ways, depending on where you are in your application development process. Follow the appropriate instructions in the following sections to create the component.

19.4.1 How to Create a Mediator

You can create a Mediator in a SOA composite application in Oracle JDeveloper at any of the following points in the development cycle:

  • When you create a composite application

  • When you modify an existing composite application

  • When you create a project

  • When you modify an existing project

When you create a Mediator, the Create Mediator dialog appears so you can name the Mediator and select a template for the interface.

To create a composite application with a Mediator:

  1. Create and Name the SOA application and project using the Create SOA Application wizard.

  2. When you reach the Configure SOA Settings page, select Composite with Mediator in the Composite Template list, as shown in Figure 19-3.

    Figure 19-3 Composite with Mediator Selection in Create SOA Project Wizard

    Description of Figure 19-3 follows
    Description of "Figure 19-3 Composite with Mediator Selection in Create SOA Project Wizard"

  3. Click Finish.

    The Create Mediator dialog appears.

  4. Configure the Mediator interface, as described in Section 19.5, "Configuring the Mediator Interface Definition".

  5. Define routing rules for the Mediator, as described in Chapter 20, "Creating Oracle Mediator Routing Rules."

To create a Mediator in an existing composite application:

  1. Open the composite application to which you are adding a Mediator in the SOA Composite Editor.

  2. Drag and drop a Mediator from the Component Palette (shown in Figure 19-4) to the Components section of the editor.

    Tip:

    The Component Palette is to the right of the SOA Composite Editor.

    Figure 19-4 Component Palette with a Mediator Service Component

    Description of Figure 19-4 follows
    Description of "Figure 19-4 Component Palette with a Mediator Service Component"

    The Create Mediator dialog appears.

  3. Configure the Mediator interface, as described in Section 19.5, "Configuring the Mediator Interface Definition".

  4. Define routing rules for the Mediator, as described in Chapter 20, "Creating Oracle Mediator Routing Rules."

To create a new project with a Mediator:

  1. Right-click in the Application Navigator, and then select New.

    The New Gallery wizard appears.

  2. Create and name a new SOA project in the SOA Tier category.

  3. On the Configure SOA Settings page of the New Gallery dialog, select Composite With Mediator from the Composite Template list, shown in Figure 19-5.

    Figure 19-5 Create SOA Project Wizard with Composite With Mediator Template Shown

    Description of Figure 19-5 follows
    Description of "Figure 19-5 Create SOA Project Wizard with Composite With Mediator Template Shown"

  4. Click Finish.

    The Create Mediator dialog appears.

  5. Configure the Mediator interface, as described in Section 19.5, "Configuring the Mediator Interface Definition".

To create a Mediator in an existing project:

  1. In the Application Navigator, select the project to which you want to add a Mediator.

  2. Right-click in the navigator pane and select New.

  3. Under Categories, select Service Components, and then select Mediator from the Items list, as shown in Figure 19-6.

    Figure 19-6 New Gallery Dialog with Mediator Service Component

    Description of Figure 19-6 follows
    Description of "Figure 19-6 New Gallery Dialog with Mediator Service Component"

  4. Click OK.

    The Create Mediator dialog appears.

  5. Configure the Mediator interface, as described in Section 19.5, "Configuring the Mediator Interface Definition".

  6. Define routing rules for the Mediator, as described in Chapter 20, "Creating Oracle Mediator Routing Rules."

19.5 Configuring the Mediator Interface Definition

When you create a new Mediator, you can specify an interface template that generates a basic set of default files in the Mediator project. These files provide a framework from which you can design and configure the Mediator. You can create a Mediator with the following interface options:

19.5.1 How to Configure the Mediator Interface Definition

You configure the interface definition for a Mediator on the Create Mediator dialog.

To configure the Mediator interface definition:

  1. Create a Mediator using one of the methods described in Section 19.4, "Creating a Mediator".

    The Create Mediator dialog appears.

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

  3. Select one of the following from the Template list. Refer to the descriptions at the beginning of this section for more information on each.

    • Define Interface Later

    • Interface Definition from WSDL

    • One-Way Interface

    • Synchronous Interface

    • Asynchronous Interface

    • Subscribe to Events

    Figure 19-7 and Figure 19-8 illustrate how the properties change on the Create Mediator dialog for different interface types.

    Figure 19-7 Synchronous Interface Template Selection on the Create Mediator Dialog

    Description of Figure 19-7 follows
    Description of "Figure 19-7 Synchronous Interface Template Selection on the Create Mediator Dialog"

    Figure 19-8 Interface Definition from WSDL Template Selection on the Create Mediator Dialog

    Description of Figure 19-8 follows
    Description of "Figure 19-8 Interface Definition from WSDL Template Selection on the Create Mediator Dialog"

  4. For any interface type except Subscribe to Events, configure the appropriate properties. For information about the displayed properties for each type, see Table 19-1 following these instructions.

  5. If you selected Subscribe to Events, do the following:

    1. Click Add on the Create Mediator dialog.

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

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

      The Event Chooser dialog appears.

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

      The SOA Resource Browser dialog appears.

    3. 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 41, "Using Business Events and the Event Delivery Network."

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

      Figure 19-10 Event Chooser Dialog

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

    5. 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.

    6. In the Run as publisher field, select whether to run the event subscription under the security of the event publisher.

      By default, event subscriptions run under the security of the event publisher.

    7. To filter the event, double-click the Filter column of the selected event, or select the event and then click the filter icon (first icon).

      The Expression Builder dialog appears.

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

      Figure 19-11 shows a sample Expression Builder dialog.

      Figure 19-11 Business Event Filter

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

      The expression you created appears in the Filter column of the Create Mediator dialog.

    9. Click OK.

  6. Click OK on the Create Mediator dialog.

  7. If you chose to create a Mediator without an interface, you must create the interface at a later time as described in Section 19.6.1, "How to Define an Interface for a Mediator."

The following table lists and describes the properties you can configure to define an interface. The available properties change depending on the interface type you select, so not all of the listed properties apply to all interface types.

Table 19-1 Mediator Interface Properties

Property Description

Create Composite Service with SOAP Bindings

Select this option to create an exposed service with SOAP bindings that is automatically connected to your Mediator when the interface is generated.

WSDL URL

Enter the location of the WSDL file to use when creating the interface from a WSDL file. Do one of the following:

  • To use an existing WSDL file, enter the name of the file or click Find existing WSDL files to browse for the file.

  • To create a new WSDL file, click Generate WSDL from schema(s).

For more information about these options, see Section 19.7, "Generating a WSDL File."

Port Type

Enter the port type name from the WSDL file. The available port types are parsed from the WSDL file that you specify in the WSDL URL field.

Callback Port Type

Enter the port type name to which the response message is sent in an asynchronous communication. The available port types are parsed from the WSDL file that you specify in the WSDL URL field.

Input

Enter the schema element for the input message. Click Search to the right of the field to select the element. By default, the singleString schema element is selected for the input message.

For a sample schema, see Example 19-2.

Output

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


Example 19-2 One-Way Interface Sample Scheme

You can use any XSD schema to specify the format of the input document that Mediator processes. Here is a sample 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>

19.5.2 What Happens When You Create a Mediator

The Mediator files are generated under the specified application and project in the Application Navigator, and the new Mediator appears in the Mediator Editor in Design view. If you created the Mediator with an interface definition and the WSDL file did not already exist, the new WSDL file is also generated with the same name as the Mediator. If the WSDL file you specified is located in a different directory than the project files, the file and its associated schema files are copied to the Mediator project.

19.5.2.1 Without an Interface Definition

This Mediator has no associated WSDL file, port types, or operations. You must define these separately as described in Section 19.6, "Defining an Interface for a Mediator." Figure 19-12 shows how a Mediator created with no interface definition appears in the Mediator Editor.

Figure 19-12 Mediator with no Interface Definition in the Mediator Editor

Description of Figure 19-12 follows
Description of "Figure 19-12 Mediator with no Interface Definition in the Mediator Editor"

19.5.2.2 With a WSDL-Based Interface

The appearance and source code of this Mediator varies depending on the name of the WSDL file and the port types and operations defined by the WSDL file. Figure 19-13 shows a sample Mediator created from a WSDL file.

Figure 19-13 Mediator from WSDL in the Mediator Editor

Description of Figure 19-13 follows
Description of "Figure 19-13 Mediator from WSDL in the Mediator Editor"

19.5.2.3 With a One-Way Interface Definition

Figure 19-14 shows how a Mediator created with a one-way interface appears in the Mediator Editor. The arrow to the left of the execute operation represents a one-way operation.

Figure 19-14 One-Way Interface Oracle Mediator in the Mediator Editor

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

19.5.2.4 With a Synchronous Interface Definition

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

Figure 19-15 Synchronous Mediator in the Mediator Editor

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

19.5.2.5 With an Asynchronous Interface Definition

Figure 19-16 shows how a 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-16 represent an asynchronous operation.

Figure 19-16 Asynchronous Mediator in the Mediator Editor

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

19.5.2.6 With an Event Subscription

When you view the Mediator in the SOA Composite Editor, the icon on the left side of the Mediator indicates that this Mediator is configured for an event subscription, as shown in Figure 19-17.

Figure 19-17 Mediator Created with the Subscribe to Events Template

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

When you double-click the Mediator, the Mediator Editor appears, as shown in Figure 19-18.

Figure 19-18 Event Subscription Mediator in the Mediator Editor

Description of Figure 19-18 follows
Description of "Figure 19-18 Event Subscription Mediator in the Mediator Editor"

19.6 Defining an Interface for a Mediator

After you create a Mediator without an interface definition, you must define the interface by subscribing to events or by defining services. You can define services in the following two ways:

19.6.1 How to Define an Interface for a Mediator

The following procedures describe how to define an interface for an existing Mediator by subscribing to events, by defining services creating a wire in the composite, and by defining services using the Mediator Editor.

To subscribe to events:

To subscribe to events, the events must be defined in an Event Definition (EDL) file.

  1. Open the Mediator you want to edit in the Mediator Editor.

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

    The Subscribed Events dialog appears.

  3. Click Add.

    The Event Chooser dialog appears.

  4. Follow the instructions under Section 19.5, "Configuring the Mediator Interface Definition" beginning with Step 5b.

  5. Click OK.

To define services for a Mediator using a wire:

  • In the 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 2.5.1, "How to Wire a Service and a Service Component."

    Note:

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

    When you define a service using a wire, the service for the Mediator is automatically defined using the WSDL file from the wire source. For example, if you connect the ReadFile service shown in Figure 19-19 to the CustomerDataRouter Mediator, the CustomerDataRouter Mediator automatically inherits the service definition of the ReadFile service.

    Figure 19-19 Connecting Mediator to a Service

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

    For information about how wiring two Mediator service components can cause an infinite loop, see Section 2.5.3, "What You May Need to Know About Adding and Deleting Wires."

To define services for a Mediator in the Mediator Editor: 

  1. Display the Mediator you want to edit in the Mediator Editor.

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

    The Define Service dialog appears, as shown in Figure 19-20.

    Figure 19-20 Define Service Dialog

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

  3. Do one of the following:

    • To use an existing WSDL file, click Find existing WSDLs to the right of the WSDL URL field.

    • To create a WSDL file, click Generate WSDL from schema(s) to the right of the WSDL URL field.

    For information about how to generate a WSDL file, see Section 19.7, "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.7 Generating a WSDL File

You can generate the WSDL file for a message using an XML schema definition (XSD) file or using a sample file. When working with Mediator, you can generate a WSDL file at either of the following times:

The Create WSDL dialog populates standard fields, such as the file name, directory, and namespace; and the dialog changes depending on the interface type you select. You can specify the same or different schema files for the message inputs.

19.7.1 How to Generate a WSDL File

The way you configure a WSDL file depends on the type of interface being defined by the WSDL file. You can define a one-way interface, a synchronous interface, or an asynchronous interface.

To generate a WSDL file for a one-way interface from an XSD file:

Perform these steps after the Create WSDL dialog appears when you are creating a Mediator or when you are defining a service for a Mediator.

  1. On the Create WSDL dialog, accept the default values or enter the following information for the WSDL file:

    Table 19-2 WSDL Properties

    Property Description

    File Name

    A unique name for the WSDL file.

    Directory

    The directory where you want to store the WSDL file. By default, it is stored in the same location as the Mediator file. This must be the current project directory or one of its subdirectories. If the specified directory does not exist, Oracle JDeveloper creates it.

    Namespace

    A namespace address for the WSDL file; for example, http://oracle.com/esb/namespaces/Mediator.

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

    Port Type

    The name of the port type in the WSDL file that contains the operation to use.

    Operation

    The name of the action to perform; for example, executeQuery.


    Note:

    Spaces and special characters are not allowed in an operation name or port type. Only alphabetic and numeric characters are supported, and the first character cannot be a number.

  2. In the Interface Type field, select One-Way Interface.

    The Input field appears, as shown in Figure 19-21.

    Figure 19-21 Create WSDL Dialog for a One-Way Interface

    Description of Figure 19-21 follows
    Description of "Figure 19-21 Create WSDL Dialog for a One-Way Interface"

  3. To the upper right of the Input field, click Add a new message part.

    The Add Message Part dialog appears, as shown in Figure 19-22.

    Figure 19-22 Add Message Part Dialog

    Description of Figure 19-22 follows
    Description of "Figure 19-22 Add Message Part Dialog"

  4. In the Part Name field, enter a name for the message part.

  5. To the right of the URL field, click the browse for schema file icon to browse for the URL.

    The Type Chooser dialog appears and contains a list of the schema files (XSD files), as shown in Figure 19-23.

    Figure 19-23 Type Chooser Dialog

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

  6. Expand the Type Explorer tree to locate and select the schema element to use.

    If the schema you want to use is not located in the project in which you are working, you can import a schema XSD file or WSDL file into the project using the Import Schema File or Import WSDL icon in the upper right corner of the dialog.

    Note:

    If you want to use a schema XSD file that resides on your local file system, ensure that the XSD file and any XSD files that it imports all reside in the Oracle JDeveloper project directory. This ensures that the schema is deployed with the project and is made available at runtime.

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

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

    The Add Message Part dialog reappears with the URL and Schema Element fields populated from the Type Chooser dialog. If you selected an XSD simple type, these fields are replaced by a Simple Type field.

  8. Click OK on the Add Message Part dialog.

    The input information appears in the Input field of the Create WSDL dialog.

  9. If needed, repeat the above steps to define additional message parts.

  10. Click OK.

    Note:

    Partner link types are generally used in BPEL, so you do not need to select Generate partnerlinkType extension for Mediator.

To generate a WSDL file for a synchronous interface from an XSD file:

Perform these steps after the Create WSDL dialog appears when you are creating a Mediator or when you are defining a service for a Mediator.

  1. On the Create WSDL dialog, enter the information for the properties listed in Table 19-2, "WSDL Properties".

  2. In the Interface Type field, select Synchronous Interface.

    The Input, Output, and Fault fields appear, as shown in Figure 19-24.

    Figure 19-24 Create WSDL Dialog for a Synchronous Interface

    Description of Figure 19-24 follows
    Description of "Figure 19-24 Create WSDL Dialog for a Synchronous Interface"

  3. To the upper right of the Input field, click Add a new message part.

    The Add Message Part dialog appears, as shown in Figure 19-25.

    Figure 19-25 Add Message Part Dialog

    Description of Figure 19-25 follows
    Description of "Figure 19-25 Add Message Part Dialog"

  4. In the Part Name field, enter a name for the message part.

  5. To the right of the URL field, click the browse for schema file icon to browse for the URL.

    The Type Chooser dialog appears and contains a list of the schema files (XSD files), as shown in Figure 19-26.

    Figure 19-26 Type Chooser Dialog

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

  6. Expand the Type Explorer tree to locate and select the schema element to use.

    If the schema you want to use is not located in the project in which you are working, you can import a schema XSD file or WSDL file into the project using the Import Schema File or Import WSDL icon in the upper right corner of the dialog.

    Note:

    If you want to use a schema XSD file that resides on your local file system, ensure that the XSD file and any XSD files that it imports all reside in the Oracle JDeveloper project directory. This ensures that the schema is deployed with the project and is made available at runtime.

    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.

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

    The Add Message Part dialog reappears with the URL and Schema Element fields populated from the Type Chooser dialog. If you selected an XSD simple type, these fields are replaced by a Simple Type element.

  8. Click OK on the Add Message Part dialog.

    The input information appears in the Input field of the Create WSDL dialog.

  9. Repeat the above steps to define message parts for the Output and Fault fields.

    The output represents the response message and is required in synchronous transactions. Faults are optional.

  10. Click OK.

    Note:

    Partner link types are generally used in BPEL, so you do not need to select Generate partnerlinkType extension for Mediator.

To generate a WSDL file for an asynchronous interface from an XSD file:

Perform these steps after the Create WSDL dialog appears when you are creating a Mediator or when you are defining a service for a Mediator.

  1. On the Create WSDL dialog, enter the information for the properties listed in Table 19-2, "WSDL Properties".

  2. In the Interface Type field, select Asynchronous Interface.

    The Input field and Callback section appear, as shown in Figure 19-27.

    Figure 19-27 Create WSDL Dialog for an Asynchronous Interface

    Description of Figure 19-27 follows
    Description of "Figure 19-27 Create WSDL Dialog for an Asynchronous Interface"

  3. To the upper right of the first Input field, click Add a new message part.

    The Add Message Part dialog appears, as shown in Figure 19-28.

    Figure 19-28 Add Message Part Dialog

    Description of Figure 19-28 follows
    Description of "Figure 19-28 Add Message Part Dialog"

  4. In the Part Name field, enter a name for the message part.

  5. To the right of the URL field, click the browse for schema file icon to browse for the URL.

    The Type Chooser dialog appears and contains a list of the schema files (XSD files), as shown in Figure 19-29.

    Figure 19-29 Type Chooser Dialog

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

  6. Expand the Type Explorer tree to locate and select the schema element to use.

    If the schema you want to use is not located in the project in which you are working, you can import a schema XSD file or WSDL file into the project using the Import Schema File or Import WSDL icon in the upper right corner of the dialog.

    Note:

    If you want to use a schema XSD file that resides on your local file system, ensure that the XSD file and any XSD files that it imports all reside in the Oracle JDeveloper project directory. This ensures that the schema is deployed with the project and is made available at runtime.

    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.

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

    The Add Message Part dialog reappears with the URL and Schema Element fields populated from the Type Chooser dialog. If you selected an XSD simple type, these fields are replaced by a Simple Type element.

  8. Click OK on the Add Message Part dialog.

    The input information appears in the Input field of the Create WSDL dialog.

  9. Repeat the above steps to define the input message parts for the Callback section.

    Note:

    The callback input represents the response message and is required in asynchronous transactions.

  10. In the Callback section, specify the following information for the response message:

    • Port Type: The name of the port type in the WSDL file that contains the operation to use.

    • Operation: The name of the action to perform; for example, executeResponse.

      Note:

      Spaces and special characters are not allowed in an operation name or port type. Only alphabetic and numeric characters are supported, and the first character cannot be a number. Both of these fields are required.

  11. Click OK.

    Note:

    Partner link types are generally used in BPEL, so you do not need to select Generate partnerlinkType extension for Mediator.

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. Use the Native Format Builder wizard to generate a WSDL file based on a sample file. The Native Format Builder wizard appears 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.8 Specifying Validation and Priority Properties

After creating a Mediator, you can configure properties for the operation or event subscription specified for the component. On the Mediator Editor, you can specify whether to validate the schemas of inbound messages and you can specify a priority for the operation or event subscription.

To validate inbound message schemas, select the Validate Syntax (XSD) check box for an operation or event subscription in the Routing Rules section of the Mediator Editor.

To specify a priority for an Oracle Mediator component, select a value from zero to nine in the Priority field in the Mediator Editor's Routing Rules section. This determines the order in which messages are retrieved for all Oracle Mediator service components. This property is only valid for parallel routing rules and not sequential. For more information about priorities, see "Basic Principles of Parallel Routing Rules".

19.9 Modifying a Mediator Service Component

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

19.9.1 How To Modify Mediator Operations

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

To modify operations:

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

    The Refresh WSDL dialog appears. If you have made any modifications to the WSDL file, 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-30 shows the Refresh WSDL dialog.

    Figure 19-30 Refresh WSDL Dialog

    Description of Figure 19-30 follows
    Description of "Figure 19-30 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 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.9.2 How To Modify Mediator Event Subscriptions

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

To modify event subscriptions:

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

    The Subscribed Events dialog appears, as shown in Figure 19-31.

    Figure 19-31 The Subscribed Events Dialog

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

  2. You can perform any of the following functions:

    • Subscribe to a new event.

    • Unsubscribe from an event.

    • Modify or specify the filter criteria for an event.

    • Modify the Consistency or Run as Roles properties of an event subscription.

      For more information about the Consistency, Run as Roles, and Filter fields of an event, see Section 19.5.1, "How to Configure the Mediator Interface Definition."

  3. Click OK.

  4. From the File menu, select Save All.