The script content on this page is for navigation purposes only and does not alter the content in any way.

36 Configuring Proxy Services and Business Services

This chapter describes the high-level aspects of configuring Oracle Service Bus business and proxy services, including the structure and use of WSDLs, service types and transports, and business service result caching with Oracle Coherence.

Oracle Service Bus proxy services and business services provide the means for managing services, transforming messages, and routing messages through the enterprise.

You can create and configure proxy services and business services using either the run-time environment (Oracle Service Bus Administration Console) or the development environment (Eclipse with Oracle Service Bus plug-ins). You can base proxy services or business services on existing Web Services Description Language (WSDL) resources, including those imported from a UDDI registry such as the Oracle Service Registry, and then further configure them in the Oracle Service Bus Administration Console or the plug-in.

36.1 Oracle Service Bus Proxy Services

Oracle Service Bus proxy services are definitions of intermediary Web services that Oracle Service Bus implements and hosts locally. Oracle Service Bus uses proxy services to route messages between business services (such as enterprise Web services and databases) and service clients (such as presentation applications or other business services).

A proxy service configuration includes its interface, transport settings, security settings, and a message flow definition. The message flow definition defines the logic that determines how messages are handled as they flow through the proxy service. If a proxy service is based on a WSDL document, the configuration also includes a WSDL port or a WSDL binding. (See Section 36.4, "Using a WSDL to Define a Service.")

36.2 Oracle Service Bus Business Services

Oracle Service Bus business services are definitions of enterprise Web services to which Oracle Service Bus is a client. Those external Web services are implemented in and hosted by external systems, so Oracle Service Bus must know what to invoke, how to invoke it, and what to expect as a result. Oracle Service Bus business services model those interfaces so that Oracle Service Bus can invoke the external services.

A business service configuration includes its interface, transport settings, and security settings. (It does not include a message flow definition.) If the business service is based on a WSDL, the configuration also includes a WSDL port or a WSDL binding. (See Section 36.4, "Using a WSDL to Define a Service.")

36.3 How WSDL is Used in Oracle Service Bus

Oracle Service Bus defines some types of business services and proxy services using a WSDL, an XML-based specification for describing Web services. A WSDL document describes service operations, input and output parameters, and how a client application connects to the service. For the WSDL 1.1 specification, see the W3C Note, "W3C Web Services Description Language (WSDL) 1.1," at http://www.w3.org/TR/wsdl.

36.3.1 About Effective WSDLs and Generated WSDLs

In Oracle Service Bus, you can base a new proxy service or a new business service on an existing WSDL (called a "WSDL resource") and then override or add configuration properties. You can also create and configure new services that are not based on existing WSDLs.

36.3.1.1 Effective WSDLs

A source WSDL serves as a template for an effective WSDL. When you create a service based on a WSDL, Oracle Service Bus generates an effective WSDL by combining settings from the original WSDL and any transport configurations you set, plus any other configuration settings you add or change from the original WSDL. Settings from the original WSDL that are not used in the new configuration are omitted from the effective WSDL.

Oracle Service Bus can generate effective WSDLs for these types of proxy services and business services:

SOAP services created from a WSDL

XML services created from a WSDL

Effective WSDLs can be generated for those types of services using any transport that supports WSDL-based services, including HTTP, JMS, SB, and so on.

Oracle Service Bus cannot generate effective WSDLs for these types of proxy services and business services:

36.3.1.2 Generated WSDLs

A generated WSDL is an effective WSDL that Oracle Service Bus generates for transport-type services that were not created from a WSDL resource but which can be described using a WSDL. For example, a WSDL generated from an EJB-based service is a generated WSDL.

36.3.1.3 Accessing Effective WSDLs

There are three ways to access an effective WSDL:

In a Web browser, enter the URL for an HTTP-based proxy service, appended with ?WSDL.

This works only for HTTP-transport-based services for which Oracle Service Bus can generate effective WSDLs.)

In a Web browser, enter the fixed HTTP URL, for example:

http://host:port/sbresource?PROXY/project_path/proxy_service_name

or

http://host:port/sbresource?BIZ/project_path/business_service_name

This works for all services for which Oracle Service Bus can generate effective WSDLs.

Export the WSDL from the Administration Console or from the plug-in. See:

Exporting the WSDL generates a .zip file that contains the effective WSDL along with associated dependencies, including schemas and WS-Policies. Oracle Service Bus evaluates the dependencies, and the appropriate location is added to the location attribute of the WSDL import element.

There is no import element for WS-policies. For WS-policies, the policy reference is retained, and the policy resource is included in the export.

36.3.2 WSDL Overview

A WSDL document describes a service, its location, its operations, and the way in which clients can communicate with it. This section provides a very brief introduction to WSDL, to provide context for discussing Oracle Service Bus features.

36.3.2.1 Types

The <types> element is a container for data type definitions. It uses a type system, such as XML Schema (XSD), to define the vocabulary of messages handled by this service. For example, a service that provides stock quotes might define an XML vocabulary, with the terms TradePriceRequest and TradePrice, as shown in Example 36-1.

36.3.2.2 Message

The <message> element provides an abstract, typed definition of the data being communicated. A message consists of parts, each of which describes one logical, abstract unit of the message. A WSDL can define one or more messages, each of which may have one or more parts. For example, the WSDL fragment in Example 36-2 defines four message types, sellerInfoMessage, buyerInfoMessage, response, and negotiationMessage, each of which has one or more parts.

36.3.2.3 Port Type

The <portType> element defines a set of operations supported by one or more endpoints (which are defined in the <port> element). The port type provides the public interface for the operations provided by the service. Each operation is defined in an <operation> element, each of which is an abstract description of an action supported by the service.

For example, the fragment in Example 36-3 defines a port type with one operation, GetLastTradePrice, which can handle an input message, GetLastTradePriceInput, and an output message, GetLastTradePriceOuput. The concrete descriptions of these messages are defined in the WSDL binding, as shown in the <soap:operation> subelement in Example 36-4.

36.3.2.4 Binding

The <binding> element specifies a concrete data format specification and a concrete transport protocol for a port type.

The fragment in Example 36-4 specifies the binding for the StockQuotePortType port type, which is provided as the value for the type attribute. The <soap:binding> subelement signifies that the binding is bound to the SOAP protocol format. In that subelement, the style attribute specifies that the data format is SOAP document style, and the transport attribute specifies that the transport protocol is HTTP.

36.3.2.5 Service and Port

The <service> element defines a collection of related endpoints, each of which is defined in a child <port> element. A port is defined as a binding associated with a network address. For example, the fragment shown in Example 36-5 defines two ports, StockQuotePort, and StockQuotePortUK. They both use the same binding, tns:StockQuoteSoapBinding, (which is concretely defined in <binding>) but have different network addresses: http://example.com/stockquote vs. http://example.uk/stockquote. These are alternative ports available for this service.

36.4.1 SOAP Document Wrapped Web Services

A document wrapped Web service is described in a WSDL as a Document Style Service. However, it follows some additional conventions. Standard document-oriented Web service operations take only one parameter or message part, typically an XML document. This means that the methods that implement the operations must also have only one parameter. Document-wrapped Web service operations, however, can take any number of parameters, although the parameter values will be wrapped into one complex data type in a SOAP message. This wrapped complex data type will be described in the WSDL as the single document for the operation.

36.4.2 SOAP Document Style Web Services

You can configure proxy services as SOAP style proxy services and configure business services as SOAP style business services.

Example 36-6 provides an example of a WSDL for a sample document style Web service using SOAP 1.1.

This is also the value of the body variable ($body) for the response returned by the proxy service using this WSDL.

There are many tools available (including Eclipse with Oracle Service Bus plug-ins) that take the WSDL of a proxy service (obtained by adding the ?WSDL suffix to the URL of the proxy service in the browser) and generate a Java class with the appropriate request and response parameters to invoke the operations of the service. This Java class can be used to invoke the proxy service that uses this WSDL.

36.4.3 SOAP RPC Web Services

You can configure proxy services as RPC style proxy services and configure business services as RPC style business services.

Example 36-9 provides an example of a WSDL for a sample RPC style Web service using SOAP 1.1.

The service described in the preceding listing includes an operation (equivalent to a method in a Java class) called lookup. The binding indicates that this is a SOAP RPC Web service. In other words, the Web service's operation receives a set of request parameters and returns a set of response parameters. The lookup operation has a parameter called request and a return parameter called result. The namespace of the operation in the binding is:

http://example.com/lookup/service/defs

When the WSDL shown in Example 36-9 is used for a request, the value of the body variable ($body) that the SOAP RPC proxy service obtains is displayed in Example 36-10.

Note:

Namespace declarations have been removed from the XML in the listings that follow for the sake of clarity.

Where soap-env is the predefined SOAP 1.1 name space, ns is the operation namespace (<http://example.com/lookup/service>) and, req is the namespace of the PurchaseOrg element (http://example.com/lookup/docs).

If the business service to which the proxy service routes the messages uses the WSDL shown in Example 36-10, the value for the body variable ($body), shown in Example 36-11, is the value of the body variable ($body) from the proxy service.

When this WSDL is used for a request, the value of the body variable ($body) for the response from the invoked business service that the proxy service receives is displayed in Example 36-10.

This is also the value of the body variable ($body) for the response returned by the proxy service using this WSDL.

There are many tools available (including Eclipse with Oracle Service Bus plug-ins) that take the WSDL of a proxy service (obtained by adding the ?WSDL suffix to the URL of the proxy in the browser) and generate a Java class with the appropriate request and response parameters to invoke the operations of that service. You can use such Java classes to invoke the proxy services that use this WSDL.

For SOAP 1.1 services, the SOAPAction header is automatically populated for services invoked by a proxy service. For SOAP 1.2 services, the action parameter of the Content-Type header is automatically populated for services invoked by a proxy service.

A WSDL is required for services using WS-Security. WS-Policies are attached to WSDLs.

The system supports the <url>?WSDL syntax, which allows you to dynamically obtain the WSDL of a HTTP proxy service. This is useful for a number of SOAP client generation tools, including Eclipse with Oracle Service Bus plug-ins. For more information, see Section 4.30, "Viewing Resources in a Web Browser."

In the XQuery and XPath editors and condition builders, it is easy to manipulate the body content variable ($body) because the editor provides a default mapping of $body to the request message in the WSDL of a proxy service. See Chapter 39, "Message Context."

The run-time contents of $body for a specific action can be different from the default mapping displayed in the editor. This is because Oracle Service Bus is not a programming language in which typed variables are declared and used. Instead, variables are untyped and are created dynamically at run time when a value is assigned. In addition, the type of the variable is the type that is implied by its contents at any point in the message flow. To enable you to easily create XQuery and XPath expressions, the design time editor allows you to map the type for a given variable by mapping the variable to the type in the editor. To learn about using the XQuery and XPath editor to create expressions, see Section 37.11, "Working with Variable Structures."

36.5 Basing Services on WSDL Ports and on WSDL Bindings

When you create a service based on a WSDL resource, you must base the service on a WSDL port or on a WSDL binding:

When you create a new service based on a binding in a WSDL resource, you are choosing the protocol and data format defined in the selected <binding> element in the WSDL resource.

When you create a new service based on a port in a WSDL resource, you are choosing the binding and the network address defined in the <port> element.

When creating or modifying the service, you can change the transport, but you cannot override the data format.

The port and binding definitions from the original WSDL resource are modified in the effective WSDL depending on a number of factors, as described below.

The following characteristics apply to effective WSDLs generated for proxy services:

The effective WSDL has one and only one wsdl:service section.

The wsdl:service section has one and only one wsdl:port section.

For SOAP services, any existing <wsdl:service> definition is removed, and a new service definition containing a single <wsdl:port> is created.

For SOAP binding over any of the supported transports the wsdl:binding section contains the standard WSDL SOAP binding elements along with a unique transport URI that identifies the transport.

For XML binding over HTTP, the wsdl:binding section uses the standard binding elements specified in the WSDL 1.1 specification.

For XML binding over any of the other supported transports the wsdl:binding section uses Oracle (Oracle Service Bus) proprietary WSDL XML binding elements.

If the service is based on a binding:

If the service is generated from binding Y in the WSDL resource, the effective WSDL defines a new service and port (<bindingname>QSService and <bindingname>QSPort). None of the ports defined in the WSDL resource are included in the effective WSDL.

There may be multiple ports in that WSDL associated with that binding. Each port can use a different URL. Therefore, the effective WSDL uses the binding but generates an artificial port from the configuration on the service for that binding. All other ports will be removed.

If the service is based on a port:

If the service is generated from port X in the WSDL resource, then port X is also defined in the effective WSDL. Any other ports defined in the WSDL resource are not included. Furthermore, if you base the proxy service on a WSDL port, the effective WSDL uses that port name. The binding is determined from the port, and in turn, the port type is determined from the binding.

The effective WSDL preserves any WS-Policies associated with the port defined in the resource WSDL.

The transport address specified in the port definition in the resource WSDL is never used as the address for a proxy service in the effective WSDL:

For HTTP services, you must specify a transport address when configuring the transport in the Administration Console or the plug-in. That address is used in the port definition in the effective WSDL.

The URL specified as the transport address for a proxy service is always relative to a path in an Oracle Service Bus domain, because Oracle Service Bus always hosts proxy services.

For SOAP-protocol-based WSDL services, the transport URI in the SOAP binding depends on the transport implementation. For standard transports (like HTTP and JMS), this value is as per the SOAP specification or another universally accepted value. For transports for which SOAP does not define a standard value, Oracle Service Bus sets one consisting of a predefined namespace with the transport ID appended at the end: http://www.oracle.com/transport/2007/05/.

There is one service element in the effective WSDL, and the port address contains a URL whose syntax and semantic is defined by the transport selected in the binding.

36.5.1.1 Characteristics of Effective WSDLs Generated for Non-Transport-Type Business Services

The following characteristics apply to effective WSDLs generated for non-transport-type business services:

The effective WSDL has one and only one wsdl:service section.

The wsdl:service section may have more than one wsdl:port sections. This is generally true when load balancing is used and there are multiple end point addresses that can be used using one of the load-balance algorithms supported.

For SOAP binding over any of the supported transports, the wsdl:binding section contains the standard WSDL SOAP binding elements along with a unique transport URI that identifies the transport.

For XML binding over any of the supported transports, the wsdl:binding section contains the Oracle WSDL XML binding elements.

The URL specified as the transport address is a remote location where the remote service is hosted.

If the service is based on a port:

The effective WSDL defines a port with the same name as the port in the template on which the new service is based. If multiple endpoint addresses are configured for the business service, the effective WSDL generated from it defines ports for all the endpoints, with the names <portname_in_template>_1, <portname_in_template>_2,...

The binding for the new service is determined from the port, and the port type is in turn determined from the binding.

The transport address URL is a remote location where the remote service is hosted.

If the service is based on a binding:

The effective WSDL defines a new service and port, based on the port in the WSDL resource. None of the ports defined in the WSDL resource are included in the effective WSDL.

A binding in the WSDL resource may be associated with multiple ports. Each port can use a different URL and have a different WS-Policy attached to it. Therefore, the generated WSDL uses the binding but generates an artificial port for that binding with no WS-Policy.

For XML-based WSDL services, standard HTTP binding is used only if the service uses HTTP transport. For all other services created from an XML-based WSDL, the effective WSDL uses Oracle binding.

36.5.1.2 Characteristics of Effective WSDLs Generated for Transport-Type Business Services

Oracle Service Bus does not guarantee one and only one wsdl:service section in effective WSDLs generated for transport-type business services. Because the WSDL is generated by the transport, Oracle Service Bus does not generate nor does it clean up extra service-port sections. Oracle Service Bus does, however, evaluate dependencies and sets their references during export.

36.5.1.3 Generating Effective WSDLs in Clustered Domains

When generating the effective WSDL in a clustered domain, Oracle Service Bus rewrites the endpoint URL based on the server or cluster configuration. If a front-end HTTP host/port (or a front-end HTTPS host/port for HTTPS endpoints) has been specified, it will be used; otherwise, the Managed Server host or port will be used. It is strongly advised that a front-end HTTP or HTTPS host/port is assigned in clustered domains.

36.5.1.4 Examples of Proxy Services Based on a Port and on a Binding

Example 36-12 shows fragments of port and binding definitions in a WSDL resource.

The service name, StockQuoteService, is the same in both the template and the effective WSDL.

The binding is the same in both the template and the effective WSDL. In this example, it specifies that the service will use the HTTP transport protocol for SOAP document style messages. (The binding also specifies the same binding operation in both the template and the effective WSDL, but that is not shown in this example.)

The second port defined in the WSDL resource, StockQuotePortUK, is not defined in the effective WSDL.

The transport address (URI) defined in the WSDL resource's port, http://example.com:9999/stockquote, is different from the address generated in the effective WSDL's port, http://host:port/project_path/proxy_service_name. The effective WSDL uses the address specified for the transport configuration in the Oracle Service Bus Administration Console or Eclipse with Oracle Service Bus plug-ins.

36.5.1.4.2 Basing the Service on a Binding

If you create a proxy service based on the StockQuoteBinding binding in Example 36-12, the effective WSDL will look something like the fragment in Example 36-14.

The service and the port in the WSDL resource are different from the service and the port generated in the effective WSDL.

The service name in the WSDL resource and the effective WSDL are different: StockQuoteService in the template and StockQuoteSoapBindingQSService in the effective WSDL.

The binding is the same in both the WSDL resource and effective WSDL. In this example, it specifies that the service will use the HTTP transport protocol for SOAP document style messages.

The binding also specifies the same binding operation in both the template and the effective WSDL, but that is not shown in this example.

The transport address (URI) defined in the WSDL resource's port, http://example.com:9999/stockquote, is different from the address generated in the effective WSDL's port, http://host:port/project/stockquote.

36.5.2 Using Any SOAP or Any XML Service Types

If you want to expose one port to clients for a variety of enterprise applications, use Any SOAP or Any XML service types. For Any SOAP, you must specify if it is SOAP 1.1 or SOAP 1.2.

36.5.3 Using the Messaging Service Type

If one of the request or response messages is non-XML, you must use the messaging service type.

36.6.1 Proxy Service Types and Transports

Each proxy service is of a certain type, and each can be used with the transport protocols appropriate for that type. Oracle Service Bus supports several standard transports plus custom transports. The service types are described in Table 36-2, including the standard transports available for each type.

Table 36-2 Proxy Service Types and Transports Supported by Oracle Service Bus

Service Type

Description

Standard Transport Protocols Supported for this Service Type

WSDL Web service

A SOAP or XML proxy service whose interface is described by a WSDL document.

HTTP

JCA

JMS

Local

SB

WS

Transport Typed Service

(no WSDL)

A service that uses a JEJB transport.

JEJB

Messaging service

(no WSDL)

A messaging service where the request message and the response message can be of different data types, including binary, text, MFL, and XML.

EMAIL

FILE

FTP

HTTP

JMS

LOCAL

MQ

SFTP

TUXEDO

Any SOAP service

(no WSDL)

A SOAP service that does not have an explicitly defined, concrete interface.

HTTP

JMS

LOCAL

SB

Any XML service

(non-SOAP, no WSDL)

An XML service that does not have an explicitly defined, concrete interface.

The transport you select should support the transport mode (request/response, one-way, or both) required by the binding definition, and it should be configured accordingly.

For services exchanging messages in both modes, you must configure the binding layer to choose the transport mode accordingly (for any transport implementing the request/response as two asynchronous calls, for example, JMS). This occurs automatically when the service is a concrete type, as it is described in the binding definition. When it is not a concrete type, to configure the binding layer, you must set the mode in the $outbound variable.

Based on the transport and WSDL, the transport mode is automatically selected, but you can overwrite it in $inbound or $outbound.

You can specify security for proxy services, using service providers. A service provider is required if the proxy service routes messages to HTTPS services that require client-certificate authentication and may be required in some message-level security scenarios.

A service account can be created to provide authentication when connecting to a business service. It acts as an alias resource for the required username and password pair.

Oracle WebLogic Server can be used to directly manage security credentials for a business service requiring credential-level validation.

For XML-based WSDL services, the variables are similar to Any XML service except that the $operation will be initialized based on the Operation Selection algorithm.

Transport Typed

Transport typed services have an empty binding definition. A WSDL is not specified.

The Transport Typed Service is an inbound transport that lets EJBs make invocations through Oracle Service Bus. It is a self-described transport that generates a WSDL to describe its service interface. The JEJB transport features transaction and security context propagation.

Messaging Service

Binding Definition: The binding definition for messaging services consists of configuring the content-type of the messages that are exchanged. The content-type for the response does not need to be the same as for the request; therefore, the response is configured separately (for example, the service could accept an MFL message and return an XML acknowledgment receipt) and could also be set to None.

As per their definition, messaging-based services do not have any WSDL definition. It is not possible to request a WSDL document for those services.

Following are the content types to choose from for the request and response:

None

Binary

Text

MFL

XML

Java

Note: If you are using a Reply action in the pipeline to propagate success or failure messages from a service to the calling client, select an option other than None. The None option blocks the reply.

Run-Time Variables:

This service type is message-based. There is no concept of multiple "operations" as for Web services. Therefore, the $operation variable is left empty.

Binding Definition: The only information this service type defines is that the service is receiving or sending SOAP messages—regardless of their WSDL binding definition. Therefore the binding configuration for this type is empty.

In addition, as there is no binding configuration, the combination of this type and the content-type of the message is sufficient to determine whether or not there are attachments to the message.

As per their definition, "any" services (SOAP or XML) do not have any WSDL definition. It is not possible to generate or view a WSDL document for those services.

Run-Time Variables:

The $body and $header variables respectively hold the <soap:Body> and <soap:Header> of the incoming SOAP message. (For SOAP 1.1 proxies, $body and $header use SOAP 1.1 namespace Body and namespace; for SOAP 1.2 proxies, they use SOAP 1.2 namespace Body and namespace.)

The $attachments variable contains the SOAP message attachments, if any.

The $operation variable is not applicable to this service type as you do not define a port type.

Binding Definition: The only information this service type defines is that the service is receiving/sending XML messages—regardless of their WSDL binding definition. Therefore, the binding configuration for this type is empty.

In addition, as there is no binding configuration, the combination of this type and the content-type of the message is sufficient to determine whether or not there are attachments to the message.

As per their definition, "any" services (SOAP or XML) do not have any WSDL definition. It is not possible to request a WSDL document for those services.

36.6.4 Configuring Message Flow

A proxy service's message flow definition defines the logic that determines how messages are handled as they flow through the proxy service. A message flow definition transforms messages, as needed, to map the message data to the format required by a business service (for outbound messages) or the originating client (for inbound messages). They then route the messages to the appropriate location. For information about configuring message flows, see Chapter 37, "Modeling Message Flow in Oracle Service Bus."

36.6.5 Security-Related Validation for Proxy Services

When you activate a session that contains changes to an active proxy service, Oracle Service Bus validates the changes to ensure that you have created all of the credentials that the proxy service's static endpoints require. For example, if you configured a proxy service to have a Web service as a static endpoint and the Web service requires a digital signature, Oracle Service Bus verifies that you have associated a service key provider with the proxy service and that the service key provider contains a key-pair binding that can be used as a digital signature.

If a session contains a change to the key-pair bindings of a service key provider, Oracle Service Bus validates the change against all of the proxy services that use the service key provider. For example, if you remove the encryption key-pair, Oracle Service Bus reports a validation error for any proxy service that references the service key provider and whose endpoint requires encryption.

The following criteria determine when Oracle Service Bus performs this security-related validation and the actions that it takes during validation:

If a proxy service specifies a static route and operation, Oracle Service Bus determines which credentials the static route and operation require. If the proxy service is missing the required credentials, Oracle Service Bus will not commit the session until you add the missing credentials.

If a proxy service specifies a static route but the operation is passed through from the inbound request, Oracle Service Bus determines which credentials the static route and each of the route's operations require. If the proxy service is missing the required credentials, Oracle Service Bus issues a validation warning but allows you to commit the session.

If a proxy service specifies a dynamic route and operation, Oracle Service Bus cannot validate the security requirements and you risk the possibility of runtime errors. For information about dynamic routing, see Section 37.8, "Using Dynamic Routing."

36.7 Configuring Business Services

The following sections provide an overview of business service configuration.

36.7.1 Business Service Types and Transport

Each business service is of a certain type, and each can be used with the transport protocols appropriate for that type. Oracle Service Bus supports several standard transports plus custom transports. The service types are described in Table 36-4, including the standard transports available for each type.

Table 36-4 Business Service Types and Transports Supported by Oracle Service Bus

Service Type

Description

Transport Protocols

WSDL Web service

A SOAP or XML business service whose interface is described by a WSDL document.

Footnote 1 Oracle recommends using the local transport for communication between two proxy services. For more information on local transport, see "Local Transport" in the Oracle Fusion Middleware Developer's Guide for Oracle Service Bus.

Footnote 2 For a Tuxedo transport-based service, if the service type is XML, an FML32 buffer with an FLD_MBSTRING field from a Tuxedo client will not be transformed to XML.

For information about configuring proxy and business services based on various transport protocols, see "Transports" in the Oracle Fusion Middleware Developer's Guide for Oracle Service Bus.

36.7.2 Configuration Settings for All Business Service Types

Each business service type is modeled following the same pattern. Each service type must define these configurations:

List of <string URI, integer weight> pairs—for example, <http://www.oracle.com, 100>. For a random-weighted list, the list should contain at least one element.

Load-balancing algorithm—enumeration, one of round-robin, random, or random-weighted. If you select random-weighted, the weights are applicable for each URI.

Retry Count

Retry Iteration Interval

Retry Application Errors

The transport you select must be able to support the transport mode (that is, request/response, one-way or both) required by the binding definition, and be configured accordingly.

For services exchanging messages in both modes (i.e., request/response and one-way), you must configure the binding layer so that it can select the transport mode accordingly. This occurs automatically when the service is a concrete type, as it is described in the binding definition. When it is not a concrete type, to configure the binding layer, you must use the routing options action in the message flow to set the mode for a route or publish.

Based on the transport and WSDL or interface, the transport mode is automatically selected, but you can overwrite it using the routing options action for a route or publish action.

Result Caching

All business services let you determine if and how to cache the results of business service invocations. This feature, available in the Message Handling section of a service configuration, improves performance on services whose results seldom change. When you enable result caching, service results are returned to the client from the cache instead of invoking the external service to obtain results.

Binding Definition: The only information this service type defines is that the service is receiving or sending SOAP messages—regardless of their WSDL binding definition. Therefore the binding configuration for this type is empty.

In addition, as there is no binding configuration, the combination of this type and the content-type of the message is sufficient to determine whether or not there are attachments to the message.

As per their definition, any services (SOAP or XML) do not have any WSDL definition.

Run-Time Variables:

The $body and $header variables respectively hold the <soap:Body> and <soap:Header> of the SOAP message to the business service being routed to or published. (For SOAP 1.1 proxies, $body and $header use SOAP 1.1 namespace Body and namespace; for SOAP 1.2 proxies, they use SOAP 1.2 namespace Body and namespace.)

The $attachments variable contains the SOAP message attachments if any.

Transport-typed services have an empty binding definition. A WSDL is not specified. Instead the transport automatically defines the WSDL for the service. A zip containing this WSDL can be exported from the Oracle Service Bus Administration Console or the Oracle Service Bus plug-ins for Eclipse. This WSDL will not have a port defined.

The EJB/JEJB Transport-Typed Service is an outbound transport to access EJBs from Oracle Service Bus. It is a self-described transport that generates a WSDL to describe its service interface. The EJB and JEJB transport features include transaction and security context propagation.

Business services built using an EJB or JEJB transport can be used for publish, service callout, and service invocation.

Any XML Service

Binding Definition: The only information this service type defines is that the service is receiving/sending XML messages—regardless of their WSDL binding definition. Therefore, the binding configuration for this type is empty.

In addition, as there is no binding configuration, the combination of this type and the content-type of the message is sufficient to determine whether or not there are attachments to the message.

As per their definition, any services (SOAP or XML) do not have any WSDL definition.

Binding Definition: The binding definition for messaging services consists of configuring the content-type of the messages that are exchanged. The content-type for the response does not need to be the same as for the request; therefore, the response is configured separately (for example, the service could accept an MFL message and return an XML acknowledgment receipt).

By definition, messaging-based services do not have any WSDL definition. It is not possible to request a WSDL document for those services.

The following content types are available for the request and response:

If a business service requires Web service security, make sure the WSDL you specify has the necessary WS-Policies attached when you create the business service. Furthermore, if the WS-Policy of the business service requires encryption, make sure the public certificate of the business service is embedded in the WSDL. If the business service is an Oracle WebLogic Server 9.0 or later Web service, you can retrieve its WSDL using the http://<host>:<port>/<service url>?WSDL URL, the public certificate will be automatically embedded for you if necessary. For more information, see Section 4.30, "Viewing Resources in a Web Browser."

36.7.4 Using Proxy Servers

You can configure business services to route messages through a proxy server. You do this by creating a proxy server resource that specifies one or more proxy servers together with the necessary credentials. You can then associate this proxy server resource with a business service. This instructs Oracle Service Bus to connect to the business service through the configured proxy server.

Adding multiple proxy servers to a resource enables Oracle Service Bus to perform load balancing and offer fault tolerance among the configured proxy servers. The credentials are used when opening a connection to the proxy server. If a particular proxy server is not reachable, Oracle Service Bus attempts to use the next proxy server in the configuration. If all proxy servers are unreachable, Oracle Service Bus tries to connect to the back end service directly. If that too fails, a fault is raised and sent back to the caller.

When configuring a proxy server, you can specify the clear text or SSL port number for the server, in addition to the host name or IP address. Note that the port specified in the proxy server resource configuration corresponds to the actual physical port of the Web proxy server and not the port of the back end service. The end point configuration on the business service, however, corresponds to the actual end point of the back end service. This is true even in the case of SSL/TLS Tunneling using HTTP CONNECT command.

Typically, for SSL/TLS Tunneling support, you do not need to install server or Certificate Authority (CA) certificates on the physical proxy server. Instead, the Web proxy server uses the certificate received from the caller (Oracle Service Bus, in this case) to open a secure socket. Similarly, when the server hosting the business application requires a client certificate, the certificate of the server hosting the proxy service (Oracle Service Bus) is used for authentication.

36.7.5 Improving Performance by Caching Business Service Results

If you use business services that return somewhat static results that do not change often, you can configure those business services to cache results. When you enable result caching, the service returns results from cache rather than invoking the external service. This improves performance by reducing network overhead to access the external service. Result caching also helps improve scalability by reducing the load on the back-end servers that host the external service.

In this section, the term "result cache" refers to the cache itself that all business services share to store their respective results, and "cached result" refers to a single result in the result cache.

For business services that use result caching, you can control the time to live for the cached result. After the cached result expires, the next business service call results in invoking the back-end service to get the result. This result is then stored in the cache for future requests to access.

The result caching mechanism that Oracle Service Bus uses is Oracle Coherence (Enterprise Edition), which is included with Oracle WebLogic Server. If a license for Oracle WebLogic Server is available for a certain processor, Coherence can be used on that machine.

The Oracle Service Bus implementation of result caching includes global enable/disable, cache message variables, configuration fields on each business service, and cache options for service statistics, debugging, alert rules, and smart search.

This section describes the Oracle Service Bus implementation of result caching.

36.7.5.1 How Result Caching Works

Figure 36-1 illustrates a client invoking a business service and receiving a response that contains cached results.

Each cached result is uniquely identified by a cache key that is made up of the ServiceRef (the unique identifier for the service which is the fully qualified path name of the service), the operation being invoked, and a cache token String. The cache token helps to uniquely identify a single cache result among other cache results for one business service. You control the value of the cache token. You can set the cache token either by configuring the Cache Token expression in the Result Caching configuration for the business service or by using the cache-token metadata element in $transportMetaData using the proxy service message flow.

If the business service locates cached results through a cache key, it returns those cached results to the client instead of invoking the external service directly.

In Figure 36-1, the solid arrows represent the message path between the client and a cached result. The dotted arrows show the message path if no cached result exists. If no cached result exists, the business service invokes the external service directly, returns the result to the client, and stores the result in cache. A result cache could be empty for a number of reasons, including: a first-time invocation where no cache yet exists, a caching error, or because the cache was flushed.

For cache expiration, cached results have a time-to-live (TTL) attribute. You can configure cache expiration either with the Expiration Time property in the Result Caching configuration on the business service or the cache-ttl element in $transportMetaData using the proxy service message flow. If Oracle Coherence finds that the TTL has expired, it flushes the cache, and the business service invokes the external service for a result. That result is then stored in the cache (if there is no error in the result), and the result is available in the cache so that it can be returned to the next request.

36.7.5.1.1 Flushing Cached Results

Oracle Service Bus/Coherence can flush an individual cached result, all cached results for a business service, or the entire result cache (all cached results for all Oracle Service Bus business services). The following events illustrate how Oracle Service Bus/Coherence flush cache:

Cache TTL has expired – Each cached result has its own TTL. When a TTL is reached, Oracle Coherence flushes that individual cached result.

Disable result caching on a single business service – When you disable result caching on a business service, Oracle Service Bus triggers flushing of all cached results for that business service in Oracle Coherence.

Update, Rename, or Delete a business service – If you update, rename, or delete a business services, Oracle Service Bus triggers flushing of all cached results for that business service from Oracle Coherence.

Update dependent resource – When you update a dependent resource, such as a WSDL, Oracle Service Bus triggers flushing all cached results for that business service from Oracle Coherence. However, changes to the following dependent resources do not cause cache flushing: Service Provider, UDDI Registry, Alert Destination.

Globally disable result caching – When you globally disable result caching, Oracle Service Bus triggers flushing the entire result cache (all cached results for all business services) from Oracle Coherence.

For more information on working with and configuring result caching, see:

36.7.5.2 Result Caching Best Practices

This section describes best practices for using result caching.

36.7.5.2.1 Security Best Practices with Result Caching

Because cached results bypass the security of invoking an external service directly, do not use result caching with business services that provide security with a non-static service account or a WS-Security policy.

36.7.5.3 Result Cache Metadata

Following are the metadata used for result caching:

36.7.5.3.1 Request Metadata

Following are the request metadata used with result caching: cache-token and cache-ttl, both String values. You can configure both in the business service configuration. You can also leave the cache token or TTL undefined in the business service and provide the cache token or TTL in the request with these metadata. When you set the cache token or TTL in the request, those values override any cache token or TTL you have defined in the business service configuration.

36.7.5.3.2 Response Metadata

cache-token – Contains the cache token that was used to retrieve content from the result cache or add content to the result cache after invoking the external service.

cache-originated – Contains a boolean value, true or false. A value of true means the returned content came from the result cache. A value of false means the returned value came from invoking the external service.

36.7.5.4 Testing Result Caching

Result caching takes effect only when the business service configured with result caching is invoked (for example, with a Route or Service Callout) from a proxy service. Therefore, in order to test result caching, do not invoke the business service directly from the Test Console. Instead, use the Test Console to test the proxy service that invokes the business service.

You can, however, invoke Split-Join business services directly to test result caching.

36.7.5.5 Result Caching Advanced Configuration

In each Oracle Service Bus domain, you can modify how the domain uses Oracle Coherence for business service result caching. This section describes default settings and when you should change them.

36.7.5.5.2 Working with Unicast and Multicast

Oracle Service Bus provides its own default Oracle Coherence configuration for the servers in a domain. The configuration file, located at DOMAIN_HOME/config/osb/coherence/osb-coherence-override.xml, provides different properties that control server access to Oracle Coherence cache.

This section describes the default Oracle Coherence configuration settings for Oracle Service Bus single- and multi-server domains, and describes scenarios in which you need to modify the default settings.

Table 36-7 shows the default system property values in osb-coherence-override.xml for a single-server domain created with the Oracle Service Bus for developers template. These unicast settings restrict Oracle Coherence cache access to only the local server. With this configuration, nodes started on different servers do not join the same Oracle Coherence cluster to share cached information.

You can modify the system properties either in osb-coherence-override.xml (requires server restart) or by specifying the system properties on server startup.

Table 36-8 shows the default system property values in osb-coherence-override.xml for a multi-server domain created with the Oracle Service Bus template. The default multicast values create an Oracle Coherence cluster that is shared by any Oracle WebLogic Server node on the same subnet created from the same template.

You can modify the system properties either in osb-coherence-override.xml (requires server restart) or by specifying the system properties on server startup.

The file provides placeholders for 9 well-known addresses (with no address values) for you to configure and use as needed.

Unicast well-known address port placeholders

<port>

OSB.coherence.wkaN.port

The file provides placeholders for 9 well-known address ports (with no port values) for you to configure and use as needed.

Multicast Listener Address

<address>

OSB.coherence.clusteraddress

228.8.8.8

Multicast Listener Port

<port>

OSB.coherence.clusterport

9888

The Multicast Address and Multicast Port properties determine how member nodes of the Oracle Coherence cluster are located. This combination must be unique for each Oracle Coherence cluster that is running within the same subnet.

Note:

Even though the Oracle Service Bus template is configured to use a multicast listener by default, a best practice is to configure the Oracle Coherence cluster to use a unicast listener with an explicit list of nodes for the Oracle Coherence cluster.

To switch to unicast, delete the multicast values and enter well-known addresses for unicast listeners. For example:

The following configurations require manual modification of osb-coherence-override.xml (or providing system property overrides as described in the previous note) to ensure the desired sharing of an Oracle Coherence cluster among multiple servers:

If you want to switch from a multicast listener to a unicast listener with well-known addresses in a cluster, as described in the previous note.

If you have multiple Oracle WebLogic Server clusters in the same subnet, modify the relevant Oracle Coherence address and port properties to ensure desired sharing of an Oracle Coherence cluster. Do not use the same address and port as those used for the Oracle WebLogic Server cluster.

If you have multiple Admin Servers with Managed Servers in the same subnet, modify the relevant Oracle Coherence address and port properties to ensure desired sharing of an Oracle Coherence cluster.

If you have any combination of Oracle WebLogic Server clusters and Admin Servers with Managed Servers in the same subnet, modify the relevant Oracle Coherence address and port properties to ensure desired sharing of an Oracle Coherence cluster.

If multiple Oracle Coherence clusters are running in the same subnet, modify the Multicast Address and Multicast Port to specify which Oracle Coherence cluster a node should connect to.

36.7.5.5.3 Using an Out-of-Process Coherence Cache Server

If you plan to use result caching heavily with Oracle Service Bus and want to avoid using too much heap space for result caching, you can set up a Coherence cache server to run on its own JVM rather than sharing an Oracle Service Bus domain JVM. Running a Coherence cache server outside of an Oracle Service Bus JVM—out of process—lets the Coherence cache server use its own heap space without affecting the heap space Oracle Service Bus uses to process messages.

Oracle Service Bus provides support for out-of-process Coherence caching with the following JAR file: OSB_ORACLE_HOME/lib/osb-coherence-client.jar.

The following steps describe how to use an out-of-process Coherence cache server:

Note:

Any out-of-process Coherence cache server used with Oracle Service Bus must use the same version of Coherence as the version included with Oracle Service Bus.

Configure the Oracle Service Bus domain to support the out-of-process Coherence cache server.

Disable local caching on each Oracle Service Bus node by adding the following argument to the Oracle Service Bus node startup:

-Dtangosol.coherence.distributed.localstorage=false

Set the Coherence cluster name with the following argument.

-DOSB.coherence.cluster=cluster_name

Configure the out-of-process Coherence cache server startup:

Make sure osb-coherence-client.jar is on the Coherence cache server classpath. For example:

-classpath coherence.jar:OSB_ORACLE_HOME/lib/osb-coherence-client.jar

Note:

The path in this example shows osb-coherence-client.jar in the default location in an Oracle Service Bus installation. In an out-of-process Coherence cache server that does not have Oracle Service Bus installed, copy this file from the Oracle Service Bus domain to the Coherence cache domain and reference it in the startup argument for all Coherence nodes.

Use osb-coherence-override.xml by adding the following argument to the Coherence cache server startup:

The path in this example shows the osb-coherence-override.xml file in the default location in an Oracle Service Bus installation. In an out-of-process Coherence cache server that does not have Oracle Service Bus installed, copy this file from the Oracle Service Bus domain to the Coherence cache domain and reference it in the startup argument for all Coherence nodes.

Use osb-coherence-cache-config.xml by adding the following argument to the Coherence cache server startup:

Add the following arguments to the Coherence cache server startup to set the host and port:

-DOSB.coherence.localhost=HOSTNAME and -DOSB.coherence.localport=PORT where host:port is unique in the cluster.

If you use a unicast listener for cluster membership (recommended), and you do not include well-known listeners in the osb-coherence-override.xml file as described in Table 36-8, add as many well-known addresses as needed to the Coherence cache server startup using the following arguments:

Make sure the Coherence cluster name is the same for the out-of-process Coherence cache server as it is for the Oracle Service Bus server by using the following startup argument:

-Dtangosol.coherence.cluster=OSB-cluster

The Oracle Service Bus cluster is always called "OSB-cluster".

Starting the Servers

When using an out-of-process Coherence cache server, which involves disabling local caching on the Oracle Service Bus server as described at the beginning this procedure, be sure to start the out-of-process Coherence cache server before starting the Oracle Service Bus server.

One way to start the Coherence cache server is to use a Java command with the desired arguments. The following example startup command assumes osb-coherence-override.xml contains the proper configurations for host, port, and well-known addresses (unicast listener):

36.7.5.5.4 More Information on Configuring and Using Oracle Coherence

You can perform many other types of cache configuration flexibly, without changing application code, using the Oracle Coherence configuration framework. For example, you can use attributes modify cache type and behavior, and you can query cache. For more information, see: