You can use different types of transports to configure proxy services or business services in Oracle Service Bus. The transport protocol you select depends on the service type, the type of authentication required, the service type of the invoking service, and so on.
Poll-based transports are transports with transport pollers pinned to a managed server. These transports use the JMS framework to ensure that the processing of a message is done at least once. E-mail, File, FTP, and SFTP are poll-based transports. This section describes the poll-based transports and the HTTP transport. For information on SFTP, see SFTP Transport.
The HTTP transport lets you send messages between clients and service providers through Oracle Service Bus using the http/s protocol. The HTTP transport also provides support for working with REST (Representational State Transfer) environments, as described in REST Support.
You can select the HTTP transport protocol when you configure any type of proxy or business service. Use the following endpoint URI formats:
Proxy Services: /someService
Business Services: http://host:port/someService
where someService is the name of proxy service or a business service
Configuring Proxy Services using the HTTP Transport
Table 1-1 describes the parameters you can specify to configure the HTTP transport for a proxy service.
Table 1-1 Parameters for Configuring HTTP Transport for Proxy Service
Parameter
Description
HTTPS Required
Select this check box for inbound HTTPS endpoints.
You must configure one of the following authentication methods:
None - Specifies that authentication is not required.
Basic - Specifies that basic authentication is required to access this service.
Basic authentication instructs WebLogic Server to authenticate the client using a user name and password against the authentication providers configured in the security realm, such as a Lightweight Directory Access Protocol (LDAP) directory service and Windows Active Directory. The client must send its user name and password on the HTTP request header.
Basic authentication is strongly discouraged over HTTP because the password is sent in clear text. However, it is safe to send passwords over HTTPS because HTTPS provides an encrypted channel.
Warning: By default, all users (authorized and anonymous) can access a proxy service. To limit the users who can access a proxy service, create a transport-level authorization policy. See Editing Transport-Level Access Policies inUsing the Oracle Service Bus Console.
Client Certificate - Specifies encrypted communication and strong client authentication (two-way SSL). To learn more, see Configuring Transport-Level Security in the Oracle Service Bus Security Guide.
Custom Authentication - Specifies that an authentication token is contained in an HTTP header. The client's identity is established through the use of this client-supplied token. You must configure an Identity Assertion provider that maps the token to an Oracle Service Bus user.
The custom authentication token can be of any active token type supported by a configured WebLogic Server Identity Assertion provider.
Dispatch Policy
Select a dispatch policy for this endpoint. Leave blank to use the default dispatch policy.
If the character set encoding parameter of the Content-Type header is not specified in Client Request, enter a character set encoding parameter. If you do not enter a value, the field defaults to ISO-8859-1.
For HTTP outbound transports:
If you have not configured a request encoding, the Oracle Service Bus run time decides the most appropriate encoding while it makes a request to the business service. In the case of a non-passthrough scenario, the default character encoding is UTF-8 at run time. However if it is a passthrough scenario, the run time will pass through the encoding received with the outbound response.
Response Encoding
Accept the default ISO-8859-1 as the character set encoding for responses in HTTP transports, or enter a different character set encoding.
Advanced Settings
Authentication Header
Enter the HTTP header (any except Authorization) from which Oracle Service Bus is to extract the token. This field is available only if you selected the Custom Authentication check box.
For example, client-xyz-token.
Authentication Token Type
Select an authentication token type. Only the active token types configured for an Identity Assertion provider are available. (See “Configuring Identity Assertion Providers” under Configuring Custom Authentication in the Oracle Service Bus Security Guide for more information.) This field is available only if you selected the Custom Authentication check box.
For more information on how to configure HTTP transport based proxy services and advanced settings, see Transport Configuration in Using the Oracle Service Bus Console.
Configuring Business Services using the HTTP Transport
You must select HTTP as the transport protocol when you configure any type of business service based on HTTP and the endpoint URI is of the form:
http://<host:port/someService>
where:
host: is the name of the system that hosts the service.
port: is the port number at which the connection is made.
someService: is a target service.
Note:
You must specify the following endpoint URI when you configure a business service based on HTTPS.
Note:
https://<host:port/someService>
Table 1-2 describes all the parameters you can specify to configure HTTP transport for a business service.
Table 1-2 Parameters for Configuring HTTP Transport for Business Service
Parameter
Description
Timeout
Enter the response timeout interval in seconds. If you enter 0, there is no timeout.
HTTP Request Method
This parameter lets you to use one of the following HTTP methods in a request:
POST – Passes all its data, of unlimited length, directly over the socket connection as part of its HTTP request body. The exchange is invisible to the client, and the URL does not change. For REST-based requests, POST tells the transport to perform a create/replace operation or perform an action with the request.
GET – You can include as part of the request some of its own information that better describes what to get. This information is passed as a sequence of characters appended to the request URL in a query string. You can use GET in a business service with a Service Type of “Any XML Service,” or with a Service Type of “Messaging Service” when the Request Message Type is set to “None.” For REST-based requests, GET retrieves a representation of a remote resource.
PUT – You can use PUT in a business service with a Service Type of “Any XML Service” or “Messaging Service.” PUT tells the transport to perform a create/replace operation with a REST-based request, such as uploading a file to a known location.
HEAD – You can use HEAD in a business service with a Service Type of “Any XML Service,” or with a Service Type of “Messaging Service” when the Response Message Type is set to “None.” HEAD tells the transport to get header information for a remote resource rather than getting a full representation of the resource in a REST-based request.
DELETE – You can use PUT in a business service with a Service Type of “Any XML Service” or “Messaging Service.” DELETE tells the transport to perform a delete operation with a REST-based request.
Note:
If a method is already set in the $outbound/transport/request/http:http-method variable, that value takes precedence over any method you select for HTTP Request Method.
Authentication
Select one of the following:
None - Specifies that authentication is not required to access this service.
Basic - Specifies that basic authentication is required to access this service.
Basic authentication instructs WebLogic Server to authenticate the client using a user name and password against the authentication providers configured in the security realm, such as a Lightweight Directory Access Protocol (LDAP) directory service and Windows Active Directory. The client must send its user name and password on the HTTP request header.
Basic authentication is strongly discouraged over HTTP because the password is sent in clear text. However, it is safe to send passwords over HTTPS because HTTPS provides an encrypted channel.
Warning: By default, all users (authorized and anonymous) can access a business service. To limit the users who can access a business service, create a transport-level authorization policy. See Editing Transport-Level Access Policies inUsing the Oracle Service Bus Console.
Client Certificate - Specifies encrypted communication and strong client authentication (two-way SSL). To learn more, see Configuring Transport-Level Security in the Oracle Service Bus Security Guide.
Service Account
A service account is an alias resource for a user name and password. This is a required field if you selected the Basic Authentication Required field.
For more information, see Service Accounts in Using the Oracle Service Bus Console.
Follow HTTP redirects
Select this check box to specify that HTTP redirects (which are requests with a response code 3xx) should be automatically followed. A re-direct occurs when you send an outbound request to the URL of a business service, and that service returns a response code (for example, 302) that says the URL is no longer valid and this request needs to be sent to another URL. If the Follow HTTP Redirects check box is selected, Oracle Service Bus automatically re-sends the request to the new URL without any action on your part. Deselect this check box if you do not want the HTTP redirects to be automatically followed.
Dispatch Policy
Select the instance of WebLogic Server Work Manager that you want to use for the dispatch policy for this endpoint. The default Work Manager is used if no other Work Manager exists. For information about Work Managers, see Using Work Managers to Optimize Scheduled Work and Create Work Manager in the WebLogic Server Administration Console Online Help.
Request Encoding
Accept the default iso-8859-1 as the character set encoding for requests in HTTP transports, or enter a different character set encoding.
Response Encoding
Accept the default iso-8859-1 as the character set encoding for responses in HTTP transports, or enter a different character set encoding.
Proxy Server
Enter a proxy server resource or click Browse to choose an entry from the list of configured proxy server resources.
For more information on how to configure this transport, see Transport Configuration in Using the Oracle Service Bus Console.
REST Support
The HTTP transport provides support for working with REST (Representational State Transfer) environments through Oracle Service Bus, whether you have REST clients that need to interact with non-REST service providers, non-REST clients that need to interact with REST-based service providers, or REST-to-REST services you want to expose through Oracle Service Bus.
In a REST pattern, you invoke HTTP methods (such as GET, PUT, HEAD, POST, and DELETE) on resources that are located at specific URLs. For example, when a user updates his own profile information in a Web application that uses REST, a POST action updates the user information in the database through the service’s REST API.
Oracle Service Bus provides the following placeholder variables for handling REST-based requests for inbound and outbound communication:
$inbound or $outbound/transport/request/http:http-method – For handling HTTP methods such as GET, PUT, HEAD, POST, and DELETE.
$inbound or $outbound/transport/request/http:query-string – For handling query strings in a URL. For example, in the URL http://localhost:7021/myproxy/weather?operation=temperature&pincode=80439/, the query string is operation=temperature&pincode=80439.
$inbound or $outbound/transport/request/http:relative-URI – For handling relative portions of a REST resource URL (relative to the proxy service URI). For example, in the URL http://localhost:7021/myproxy/weather, /weather is a relative URL to http://localhost:7021/myproxy.
REST in Proxy Services
With an Oracle Service Bus proxy service, you have the flexibility to interact with REST patterns, whether you are receiving REST-based requests or generating REST-based actions.
For example, if your team wants to develop REST-based applications and invoke services in a non-REST service provider, you can send REST operations through a proxy service and transform those operations into a format the service provider understands; or you could transform a non-REST request into a resource URL and invoke an operation in a REST-based service provider.
XQuery Examples
Following are XQuery examples of URI parsing using HTTP variables in a proxy server.
Relative-URI
A proxy service has a URI http://localhost:7001/weather, and you want to capture the relative URI parts of a request. You create the following XQuery:
<relative-URI> { for $c in fn:tokenize($inbound/ctx:transport/ctx:request/http:relative-URI, "/") where fn:string-length($c) != 0 return <part> {$c} </part> } </relative-URI>
If a request comes with the URI of http://localhost:7001/weather/temperature/35457, the relative-URI will be /temperature/35457, and the XQuery output will be:
A proxy service has a URI http://localhost:7001/weather, and you want to capture the URL query string. You create the following XQuery:
<query-params> { for $c in fn:tokenize($inbound/ctx:transport/ctx:request/http:query-string, "&") return <param name="{fn:substring-before($c,"=")}" value="{fn:substring-after($c,"=")}"></param> } </query-params>
If a request comes with a URI of http://server:7001/weather?operation=temperature&pincode=35457, the query-string will be operation=temperature&pincode=35457, and the XQuery output will be:
If your service requires specific headers to handle HTTP/REST methods, create user-defined HTTP header variables in your proxy service message flow.
REST in Business Services
With an Oracle Service Bus business service, you can invoke REST-based services.
For REST operations, the HTTP transport uses the value in the $outbound/transport/request/http:http-method variable. If that variable does not supply an HTTP method, the HTTP transport lets you select one of the following HTTP Request Methods in the transport configuration: POST, PUT, HEAD, GET, AND DELETE.
Note:
If the business service uses a Service Type of WSDL Web Service, only the POST method is available.
Using the $outbound/transport/request-http/http-method variable, you can also supply your own methods. For example, you can use COPY, MOVE, and LOCK for WebDAV environments (Web-based Distributed Authoring and Versioning).
Use the following guidelines for setting $outbound variables:
The transport does not provide run-time validation for custom methods or for manually set supported methods that do not comply with the constraints described in this section.
Since $outbound is only available in a Routing node, you cannot specify a method name at run time for publish and service callout actions.
If the $outbound query-string is set, the business service passes the query string as part of the URI while invoking an external service.
If the $outbound relative-URI is set, the business service uses that value to generate the URI, which is relative to the business service URI.
For example, in a business service with a URI of
http://service.com/purchaseOrder
and the following HTTP variables
$outbound/transport/request-http/relative-URI: “/PO12367” and $outbound/transport/request-http/query-string: “item=NO1&color=black”
The HTTP transport provides the following response codes for HTTP methods:
Method
Response Codes
POST
200 (OK)
201 (Created)
204 (No Content)
PUT
200 (OK)
201 (Created)
204 (No Content)
301 (Moved Permanently) – The server sends the response code. The business service handles this response by resending the original request.
HEAD, GET
200 (OK)
DELETE
200 (OK)
202 (Accepted)
204 (No Content)
E-mail Transport
You can select the e-mail transport protocol when you configure a Messaging Type or Any XML Service type of proxy service or business service. The following topics describe how to configure proxy services and business service using the E-mail transport.
Note:
E-mail transport supports one-way messaging for services of Messaging Services type.
Note:
When you create a messaging type proxy service or a messaging type business service using e-mail transport you must set the response type to none in the Message Type configuration page.
Configuring Proxy Services using the E-mail Transport
When you configure a proxy service using the e-mail transport, you must specify an endpoint URI in the following format:
mailfrom:<mailserver-host:port>
where mailserver-host: is the name of the host mail server port: is the port used by the mail server host.
Table 1-3 describes the parameters you can configure for an e-mail transport based proxy service.
Table 1-3 Parameters for Configuring E-mail Transport for Proxy Services
Parameter
Description
Service Account
This is a mandatory parameter. This is the service account resource. The service account consists of a user name/password combination required to access the e-mail account.
Polling Interval
This is a mandatory parameter. This parameter specifies the polling interval in milliseconds. The default value is 60 ms.
E-mail Protocol
This is a mandatory parameter. There are two types of protocol from which you can select, imap and pop3. The default protocol is pop3.
Read Limit
This is a mandatory parameter. This specifies the number of files to be read in each poll. The default value is 10.
Pass By Reference
If this parameter is enabled, the file is staged in the archive directory and passed as a reference in the message headers.
Post Read Action
This is a mandatory parameter. This specifies whether the files should be deleted, moved, or archived after being read by the service. By default the files are deleted after reading.
Attachments
This is a mandatory parameter. This parameter specifies if the attachments are to be archived or ignored. By default this parameter is set to ignore.
Note:
If attachments are archived, the attachment files are passed as a reference in the message headers irrespective of the settings for the Pass By Reference parameter.
IMAP Move Folder
This is the destination of the messages if the Post Read Action is set to move.
You must configure this field only if Post Read Action is set to move.
Download Directory
This is a mandatory parameter. It specifies the file system directory path to download the message.
Archive Directory
This is a mandatory parameter. A file URI that points to the directory where the files are archived. This field is active only when Post Read Action parameter is set to archive.
Error Directory
This is an optional parameter. This parameter specifies the type of encoding to read the request message. The default encoding is iso-8859-1.
For more information on how to configure e-mail services, see Transport Configuration in Using the Oracle Service Bus Console.
Configuring Business Services using the E-mail Transport
When you configure a business service using the e-mail transport, you must specify the endpoint URI in the following format:
mailto:<name@domain_name.com>
where <name@domain_name.com> is the e-mail destination.
Table 1-4 describes the parameters you can configure for an e-mail transport based proxy service.
Table 1-4 Parameters for Configuring E-mail Transport for Business Services
Parameter
Description
SMTP Server
You must select an SMTP Server from the drop-down list.
You must first create the SMTP Server resource.
Mail Session
This parameter is optional. It is the JNDI name of the configured mail session. You can select mail sessions from the drop-down list.
From Name
You must first configure mail sessions in the WebLogic Server Console.
From Address
Create a Mail Session in WebLogic Server Administration Console. You must set the Mail Session parameter or the SMTP Server parameter.
Reply To Name
This is an optional parameter. This parameter specifies the name from which the reply should be sent.
Reply To Address
This is an optional parameter. This parameter specifies the e-mail address from which the e-mail message should be sent.
Connection Timeout
This is an optional parameter. You can use this parameter to specify time in milliseconds after which the connection to the SMTP server times out.
Request Encoding
This is an optional parameter. This parameter specifies the type of encoding to read the request message. The default encoding is iso-8859-1.
For more information on how to configure this transport, see Transport Configuration in Using the Oracle Service Bus Console.
File Transport
You can select the File transport protocol when you configure a Messaging Type or Any XML Service type of proxy service and the endpoint URI is of the form:
file:///<root-dir/dir1>
where root-dir/dir1 is the absolute path to the destination directory.
Note:
File transport supports one-way messaging only for services of Messaging Service type.
Note:
When you create a messaging type proxy service or a messaging type business service using file transport you must set the response type to none in the Message Type configuration page.
Configuring Proxy Services using the File Transport
Table 1-5 describes the parameters you can specify to configure the file transport for a proxy service.
Table 1-5 Parameters for Configuring File Transport for Proxy Services
Parameter
Description
File Mask
This is an optional parameter. This specifies the files that should be polled by the proxy service. If the URI is a directory and *.* is specified, then the service will poll for all the files in the directory.
Polling Interval
This is a mandatory parameter. This specifies the value for the polling interval in milliseconds. The default value is 60 ms.
Read Limit
This is a mandatory parameter. This specifies the number of files to be read in each poll. The default value is 10. If 0 is specified, all the files are read.
Sort By Arrival
This is an optional parameter. This parameter indicates the sequence of events raised in the order of the arrival of files. The default value for this parameter is False.
Scan Subdirectories
This is optional. If enabled, the sub-directories are also scanned.
Pass By Reference
If this parameter is enabled, the file is staged in the archive directory and passed as a reference in the headers.
Post Read Action
This parameter is mandatory. This specifies whether the files should be deleted or archived after being read by the service. By default the files are to be deleted after reading.
Stage Directory
This is a mandatory parameter. This file URI points to the staging directory.
Note:
You must not put the stage directory inside the polling directory.
Archive Directory
This is a mandatory parameter. This file URI points to the directory where the files are archived. This field is active only when Post Read Action parameter is set to archive.
Note:
You must not put the archive directory inside the polling directory
Error Directory
This is a mandatory parameter. This URI points to a directory, in which the contents of the file will be stored in case of a error.
Note:
You must not put the error directory inside the polling directory
Request Encoding
This is an optional parameter. This parameter specifies the type of encoding to read the request message. The default encoding is utf-8.
For more information on how to configure file transport based proxy services, see Transport Configuration in Using the Oracle Service Bus Console.
Configuring Business Services using the File Transport
When you configure a business service using the file transport you must specify the endpoint URI in the following format:
file:///<root-dir/dir1>
where root-dir/dir1 is the absolute path to the destination directory.
Table 1-6 describes the parameters you can specify to configure the file transport for a proxy service.
Table 1-6 Parameters for Configuring File Transport for Business Services
Parameter
Description
Prefix
This is an optional parameter. This parameter specifies the prefix to be attached to the filename.
Suffix
This is an optional parameter. This parameter specifies the suffix to be attached to the filename.
Request Encoding
This is an optional parameter. This specifies the type of encoding to read the message. The default encoding which will be used is utf-8.
For more information on how to configure this transport, see Transport Configuration in Using the Oracle Service Bus Console.
FTP Transport
You can select the FTP transport protocol when you configure a Messaging Type or Any XML Service type of proxy service and the endpoint URI is of the form:
ftp://<hostname:port/directory>
where
hostname– is the name of the host on which the destination directory is stored.
port– is the port number at which the FTP connection is made.
directory– is the destination directory.
Note:
File transport supports one-way messaging for services of Messaging Services type.
Note:
When you create a messaging type proxy service or a messaging type business service using FTP transport you must set the response type to none in the Message Type configuration page.
Configuring Proxy Services using the FTP Transport
Table 1-7 describes the parameters you can specify the parameters to configure the FTP transport for a proxy service.
Table 1-7 Parameters for Configuring FTP Transport for Business Services
Parameter
Description
User Authentication
You must select one of the following types of user authentication:
anonymous– If you select anonymous, you do not require any login credentials to login to the FTP server, but you optionally supply your e-mail ID for identification.
external user– If you select external user, you have to reference a Service Account resource, which contains your user name/password for the FTP server.
Pass By Reference
This is an optional parameter. If this parameter is enabled, the file is staged in the archive directory and passed as a reference in the headers.
Remote Streaming
This is an optional parameter. Setting this parameter to True will poll FTP files directly from the remote server at processing time.
File Mask
This is a mandatory parameter. This specifies the files that should be polled by the proxy service. If the URI is a directory and *.* is specified, then the service will poll all the files in the directory.
Polling Interval
This is a mandatory parameter. This specifies the value for the polling interval in milliseconds. The default value is 60 ms.
Read Limit
This is a mandatory parameter. This specifies the number of files to be read in each poll. The default value is 10.
Post Read Actions
This is a mandatory parameter. This specifies whether the files should be deleted or archived after being read by the service. By default, the files are deleted after reading.
Transfer Mode
This parameter specifies whether the mode of file transfer is binary or ASCII. By default the transfer is binary.
Stage Directory
This is a mandatory parameter. This file URI points to the staging directory.
Archive Directory
This is a mandatory parameter. This file URI points to the directory where the files are archived. This field is active only when Post Read Action parameter is set to archive.
Error Directory
This is a mandatory parameter. This URI points to a directory location, where the contents of the file will be stored in case of a error.
Request Encoding
This is an optional parameter. This parameter specifies the type of encoding to read the request message. The default encoding is utf-8.
Advanced Settings
Click the icon to expand the Advanced Settings section. Configuring parameters in this section is optional. The parameters you can set in this section are:
Scan Subdirectories– This is optional. If enabled the sub-directories are also scanned.
Sort By Arrival
Timeout
Retry
For more information on how to configure file transport based proxy services, see Transport Configuration in Using the Oracle Service Bus Console.
Configuring Business Services using the FTP Transport
You can select the FTP transport protocol when you configure a Messaging Type or Any XML Service type of business service and the endpoint URI is of the form:
ftp://<hostname:port/directory>
where
hostname– is the name of the host on which the destination directory is stored.
port– is the port number at which the FTP connection is made.
directory– is the destination directory.
Table 1-8 describes the parameters you must specify to configure the FTP transport for a business service.
Table 1-8 Parameters for Configuring FTP Transport for Business Service
Parameter
Description
User Authentication
You must select one of the following types of User Authentication:
anonymous– If you select anonymous, you do not require any login credentials to login to the FTP server. But you optionally supply your e-mail ID for identification.
external user– If you select external user, you have to reference a Service Account resource, which contains your user name/password for the FTP server.
Prefix for destination filename
This is a mandatory parameter. This parameter specifies the prefix to be attached to the filename.
Suffix for destination filename
This is a mandatory parameter. This parameter specifies the suffix to be attached to the filename.
Request Encoding
This is an optional parameter. This parameter specifies the encoding for the request message.
For more information on how to configure this transport, see Transport Configuration in Using the Oracle Service Bus Console.