23 Understanding Message Exchange Patterns of an Oracle Mediator

This chapter describes common message exchange patterns between an Oracle Mediator service component and other applications.

This chapter includes the following sections:

Notes:

The following exchange patterns show the default handling of responses, faults, and callbacks by Oracle JDeveloper when a routing rule is created. Keep in mind the following points for all the cases:
  • When a response, fault, or callback is sent back to the caller, it is also possible to route the same message to a different target service or event by clicking the button next to the target and selecting a different target.

  • When the caller of the Oracle Mediator expects a response, one or more routing rules may route the request to a target that does not return a response, but there should be at least one sequential routing rule that returns a response.

  • If you have multiple routing rules involved in a request-response interaction, then the routing rules that send the response back to the initial caller should precede other routing rules, if any, that forward the response.

  • The asynchronous request-reply pattern in Oracle Mediator is supported only for web services. This exchange pattern is not supported for adapters and other services.

23.1 Understanding a One-way Message Exchange Pattern

In a one-way interaction, the Oracle Mediator is invoked, but it does not send a response back to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-1:

Table 23-1 Response When Oracle Mediator's WSDL Is a One-way Interaction

Routing Rule Target Type Response

Request

No response.

Request Response

Response is forwarded to another target or event.

Request Response Fault

Response and fault are forwarded to another target or event.

Request Callback

Callback is forwarded to another target or event.

Request Response Callback

Response and callback are forwarded to another target or event.

Request Response Fault Callback

Response, fault, and callback are forwarded to another target or event.


Figure 23-1 illustrates the one-way message exchange pattern.

Figure 23-1 One-way Message Exchange Pattern

Description of Figure 23-1 follows
Description of "Figure 23-1 One-way Message Exchange Pattern"

23.1.1 The one.way.returns.fault Property

The one.way.returns.fault property controls how faults and one-way messages are handled for one-way interface SOAP calls. You can add this property to the service binding component of the web service section for one-way web services in the composite.xml file. This property is not applicable to references. It is applicable only to services and only to the binding.ws binding type. Table 23-2 provides more details on this property.

Table 23-2 one.way.returns.fault Property

If one.way.returns.fault Is... Then...

Set to true:

. . .
<service name="Mediator1_2"
 ui:wsdlLocation="ReadFile.wsdl">
    <interface.wsdl
 interface="http://xmlns.oracle.com/pcbpel/adapter/file
 /LocalSandbox/Project1/ReadFile%2F#wsdl.interface(Read_
ptt)"/>
    <binding.ws
 port="http://xmlns.oracle.com/pcbpel/adapter/file
/LocalSandbox/Project1/ReadFile%2F#wsdl.endpoint
(Mediator1/Read_pt)">
   <property name="one.way.returns.fault" type="xs:string" many="false"
     override="may">true</property>
    </binding.ws>
</service>
. . .

Any fault that occurs during downstream processing returns a SOAP fault to the client and an HTTP response code of 500. (The same behavior as 11g Release 1.)

Set to false:

. . .
<service name="Mediator1_2"
 ui:wsdlLocation="ReadFile.wsdl">
    <interface.wsdl
 interface="http://xmlns.oracle.com/pcbpel/adapter/file/
Local Sandbox/Project1/ReadFile%2F#wsdl.interface(Read_
ptt)"/>
    <binding.ws
port="http://xmlns.oracle.com/pcbpel/adapter/file/LocalSan
dbox/Project1/ReadFile%2F#wsdl.endpoint(Mediator1/Read_
pt)">
      <property name="one.way.returns.fault"
 type="xs:string" many="false"
                override="may">false</property>
    </binding.ws>
  </service>
. . .

Any fault that occurs during downstream processing returns only an HTTP response code of 500. No SOAP fault is returned to the client.

Not set (the default case)

Any fault that occurs during downstream processing returns a SOAP fault to the client and an HTTP response code of 500. (The same behavior as 11g Release 1.)


To add the one.way.returns.fault property:

  1. In the SOA Composite Editor, select the service binding component to which you want to add the one.way.returns.fault property.

  2. Go to the Property Inspector section in the lower right part of the editor.

  3. In the Binding Properties section, click the Add icon.

    The Create Property dialog is displayed.

  4. In the Name field, enter one.way.returns.fault.

  5. In the Value field, enter true or false.

  6. Click OK.

23.2 Understanding a Request-Reply Message Exchange Pattern

In a request-reply interaction, the Oracle Mediator is invoked and sends a reply to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-3:

Table 23-3 Response When Oracle Mediator's WSDL Is a Request Reply

Routing Rule Target Type Response

Request

There is no response from the target, but there should be at least one sequential routing rule with a request-response service.

Request Response

The response is sent back to the caller. The response can be forwarded to another target or event, but there should be at least one sequential routing rule that returns a response back to the caller.

Request Response Fault

The response is sent back to the caller. The fault is forwarded to another target or event.

Request Callback

There is no response from the target, but there should be at least one sequential routing rule with a request-response service. The callback is forwarded to another target or event.

Request Response Callback

The response is sent back to the caller. The callback is forwarded to another target or event.

Request Response Fault Callback

The response is sent back to the caller. The callback and fault are forwarded to another target or event.


Figure 23-2 illustrates the request-reply message exchange pattern.

Figure 23-2 Request-Reply Message Exchange Pattern

Description of Figure 23-2 follows
Description of "Figure 23-2 Request-Reply Message Exchange Pattern"

23.3 Understanding a Request-Reply-Fault Message Exchange Pattern

In a request-reply-fault interaction, the Oracle Mediator is invoked and sends a reply and one or more faults back to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-4:

Table 23-4 Response When Oracle Mediator's WSDL Is a Request Reply Fault

Routing Rule Target Type Response

Request

There should be at least one sequential routing rule with a request-response-fault service. Oracle Mediator returns null when there is no response to be sent.

Request Response

The response is sent back to the caller. Any exception in Oracle Mediator message processing may result in a fault.

Request Response Fault

The response and fault are sent back to the caller. Any exception in Oracle Mediator message processing may result in a fault.

Request Callback

There is no response from the target, but there should be at least one sequential routing rule with a request-response service. Oracle Mediator returns null when there is no response to be sent. The callback is forwarded to another target or event.

Request Response Callback

The response is sent back to the caller. Any exception in Oracle Mediator message processing may result in a fault.

Request Response Fault Callback

The response and fault are sent back to the caller. Any exception in Oracle Mediator message processing may result in a fault.


Figure 23-3 illustrates the request-reply-fault message exchange pattern.

Figure 23-3 Request-Reply-Fault Message Exchange Pattern

Description of Figure 23-3 follows
Description of "Figure 23-3 Request-Reply-Fault Message Exchange Pattern"

23.4 Understanding a Request-Callback Message Exchange Pattern

In a request-callback interaction, the Oracle Mediator is invoked and may send an asynchronous reply to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-5:

Table 23-5 Response When Oracle Mediator's WSDL Is a Request Callback

WSDL of the Routing Rule Target Response

Request

There should be at least one sequential routing rule with a request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Response

The response is sent back to the caller, as a callback, in a separate thread.

Request Response Fault

The response is sent back to the caller, as a callback, in a separate thread. The fault is forwarded to another target or event.

Request Callback

The callback is sent back to the caller.

Request Response Callback

The callback is sent back to the caller, and the response is forwarded to another target or event.

Request Response Fault Callback

The callback is sent back to the caller. The response and fault are forwarded to another target or event.


Figure 23-4 illustrates the request-callback message exchange pattern.

Figure 23-4 Request-Callback Message Exchange Pattern

Description of Figure 23-4 follows
Description of "Figure 23-4 Request-Callback Message Exchange Pattern"

23.5 Understanding a Request-Reply-Callback Message Exchange Pattern

In a request-reply-callback interaction, the Oracle Mediator is invoked and sends a response and an asynchronous reply to the initial caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-6:

Table 23-6 Response When Oracle Mediator's WSDL Is a Request Response Callback

Routing Rule Target Type Response

Request

There should be at least one sequential routing rule that returns a response. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Response

There should be at least one sequential routing rule that returns a response. No callback is sent if there is no routing rule with a defined callback.

Request Response Fault

There should be at least one sequential routing rule that returns a response. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Callback

There should be at least one sequential routing rule that returns a response. Oracle Mediator returns null when there is no response to be sent.

Request Response Callback

The response and callback are sent back to the caller.

Request Response Fault Callback

The response and callback are sent back to the caller. The fault is forwarded to another target or event.


Figure 23-5 illustrates the request-reply-callback message exchange pattern.

Figure 23-5 Request-Reply-Callback Message Exchange Pattern

Description of Figure 23-5 follows
Description of "Figure 23-5 Request-Reply-Callback Message Exchange Pattern"

23.6 Understanding a Request-Reply-Fault-Callback Message Exchange Pattern

In a request-reply-fault-callback interaction, the Oracle Mediator is invoked and sends a response, an asynchronous reply, and one or more fault types to the initial caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-7:

Table 23-7 Response to a Request Response Fault Callback Oracle Mediator

WSDL of the Routing Rule Target Response

Request

There should be at least one sequential routing rule with a request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Response

There should be at least one sequential routing rule with a request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Response Fault

There should be at least one sequential routing rule with a request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback.

Request Callback

There should be at least one sequential routing rule that returns a response. Oracle Mediator returns null when there is no response to be sent.

Request Response Callback

The response and callback are sent back to the caller. Any exception in Oracle Mediator message processing may result in a fault.

Request Response Fault Callback

The response, fault, and callback are sent back to the caller.


Figure 23-6 illustrates the request-reply-fault-callback message exchange pattern.

Figure 23-6 Request-Reply-Fault-Callback Message Exchange Pattern

Description of Figure 23-6 follows
Description of "Figure 23-6 Request-Reply-Fault-Callback Message Exchange Pattern"