Skip Navigation Links | |
Exit Print View | |
![]() |
Oracle Java CAPS REST Binding Component User's Guide Java CAPS Documentation |
Using the REST Binding Component
About the REST Binding Component
REST Binding Component Features
Working With the REST BC WSDL Document
Creating the REST BC WSDL Document
To Create a WSDL Document for REST Inbound
To Create a WSDL Document for REST Outbound
New WSDL Wizard Properties for REST
Configuring REST BC WSDL Attributes
To Configure REST BC WSDL Attributes
Service Level REST WSDL Element
Binding Level REST WSDL Elements
Configuring the REST Binding Component Runtime Properties
To Configure REST BC Runtime Properties
REST Binding Component Runtime Property Descriptions
Creating Application Configurations for Connectivity Parameters (URLs)
To Create Application Configurations
To Add the Application Configuration to the Endpoint
To Change Application Configuration Values
To Create an Application Variable
To Use an Application Variable for Password Protection
Using REST BC Normalized Message Properties in a Business Process
Using Predefined Normalized Message Properties
To Use Predefined Normalized Message Properties in Mapper View
To Use Predefined Normalized Message Properties in Source View
Normalized Message Properties for REST
You can use Jersey client filters to modify a REST request or response for an outbound REST client interaction. For example, you can define a filter for generating the appropriate authentication header based on user-supplied information. To implement filters, you need to define the logic
You define the client filter in a Java Application project in NetBeans using the Jersey client API to define the logic. For more information about the Jersey API, see the Jersey 1.0.3.1 Javadocs. The following are the primary classes of interest:
com.sun.jersey.api.client.ClientHandlerException
com.sun.jersey.api.client.ClientRequest
com.sun.jersey.api.client.ClientResponse
com.sun.jersey.api.client.filter.ClientFilter
The New Project Wizard appears.
The Name and Location window appears.
The project is created and a Java file containing the code framework appears in the Java Editor.
The Properties window appears.
jersey-bundle-1.0.3.1.jar
jsr311-api-1.0.jar
Tip - You can find these files in glassfish-home/lib.
Use standard Java methods along with the methods defined in the Jersey API to define the filter, exception, and logging logic. See the example following this procedure for a simple implementation.
Example 2 Simple Authentication Filter
The following example illustrates the code for a simple authentication filter that has a user name and password as parameters.
package javafilter; import com.sun.jersey.api.client.ClientHandlerException; import com.sun.jersey.api.client.ClientRequest; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.filter.ClientFilter; import java.util.logging.Level; import java.util.logging.Logger; public class Filter extends ClientFilter { private static final Logger logger = Logger.getLogger(Filter.class.getName()); private String username; private String password; public Filter() { } public void setUsername(String username) { this.username = username; } public void setPassword(String password) { this.password = password; } @Override public ClientResponse handle(ClientRequest request) throws ClientHandlerException { logger.log(Level.INFO, "inside handle() method, username=" + username + ", password=" + password); ClientResponse response = getNext().handle(request); return response; } }
Before You Begin
Before you can perform this step, you need to complete the following steps:
Create the BPEL Module that implements the REST Binding Component.
Create and build the composite application for the BPEL Module.
Create he Java Application that defines the filter (as described in To Define the Jersey Filter), and build the Java Application project.
The Properties Editor appears.
The Filters Editor appears.
The Select Java Libraries dialog box appears.
The information from the Java Application project is populated into the Filter Editor.
The filter name appears in the Filters property.