7.1.10

Sample JSF 11g application that uses UCM search SOAP API and HTTP basic authentication

Here are some steps to create an application that uses UCM search API (SOAP based) and shows the results in the web page. In addition I will explain how to setup HTTP basic authentication to enable calling UCM web services.

Create an application

 

You start with creating an application

image

image

image

Give descriptive name for the default web project

image

image

Create JSF page

 

image

image

image

By default we start with the quick start layout:

image

image

Create web service data control based on UCM search WSDL

 

In this part I’ve already downloaded the UCM WSDL descriptions using another UCM instance. The SOAP API is still the same but WSDL points to another hostname as the endpoint. We will modify this later.

 

image

Choose “All Technologies” tab in the left hand side + Web Service Data Control” in the right hand side:

image

Browsing for the search API WSDL file:

image

image

image

I only choose one operation to be used:

image

image

Just click next(s):

image

image

image

Please note that at this point the end point that was derived from WSDL is still pointing to a wrong installation, and I will correct this error later in this guide.

Changing the end point URL for web service (optional)

 

Navigate to the DataControls.dcx file

image

Look into the bottom left hand side Structure pane:

image

Press mouse right click button to open context menu. Choose “Edit Web Service Connection…”

image

Let’s change the hostname. Leave username and password fields intact since they are not used as http basic authentication.

image

image

Adding input parameter field for search text

 

Next I will build up a very simple search form for UCM documents:

Select “Input Text” from component palette and drag’n’drop into the left hand pane:

image 

image

You could change the field names and labels to something more descriptive:

image

Add search results table

 

Next I will drag’n’drop the search results control to the right hand side:

image

image

image

I will only choose some of the columns by deleting the unwanted columns.

image

Leave this dialog to be as-is, press OK.

image

Add search command button

 

Next I will create a command button that will actually execute the query (calls the web service API eventually).

Select the QuickSearch operation from data control and drag’n’drop it into the left pane:

image

image

image

Bind the parameter to the input field

 

Many cases JDeveloper will automatically bind the input parameters from UI to the web service parameters, but here I’ll show you one way to do it when web full automation is not possible.

Navigate to the web service “Parameters” folder and choose the “queryText” parameter. Drag’n’drop it to the input field in JSF page.

image

Bind the input text field:

image

Let the defaults be there and press Ok:

image

image

Binding from input field to the parameter is now done.

Add HTTP basic authentication policy

 

To enable HTTP basic authentication you need to define web service security settings. I start choosing DataControls.dcx which reveals me data control structure, where I select the wanted data control.

image

Press context menu and choose “Define Web Service Security…”:

image

Press “+” to add new security policy:

image

Choose “oracle/wss_http_token_client_policy”:

image

Press “Override Properties..:”

image

Press “New key…”

image

Enter username and password for the end point (actually these will be overriden in the later phase). Enter key name that will be used to find the username and password settings from at runtime.

image

image

Csf-key is important to remember since this will be used to store the username and password for the endpoint in domain keystore.

image

image

Create deployment profiles for project and application and deploy

 

You need to first create WAR deployment profile for the project.

Then you create EAR deployment profile for the application and define the dependency to the WAR deployment profile.

You should deploy the application (not WAR).

Define credentials key under oracle.wsm.security

 

Login to the Fusion Middleware Enterprise manager console. The URL is something like http://localhost:7001/em

image

Press “Create Key”. Key attribute here is the csf-key you defined earlier. In my example I used csf-key “demo-ucm-search”. These are the actual username and password that are used when initiating the connection to UCM.

image

image

Test and run

Deploy the application to the domain and you should be fine with the application based on UCM SOAP APIs.

image

UCM search API uses special search notation, so I wanted to search for UCM documents that had “visa” in the document title. I enter the query criteria dDocTitle <substring> `visa`.

image