Skip Headers
Oracle® Fusion Middleware Federated Portals Guide for Oracle WebLogic Portal
10g Release 3 (10.3.5)

Part Number E14235-06
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

8 Configuring a WebLogic Server Producer

By default, WebLogic Portal projects deployed to a WebLogic Portal domain are configured to function as WSRP producers. If you want to use a Basic WebLogic Server or WebLogic Express domain as a producer, some configuration is required. This chapter explains how to configure a Basic WebLogic Server or WebLogic Express domain as a WSRP producer. Portlets deployed to the server can then be used by consumer applications.

This chapter includes the following topics:

8.1 Introduction

This chapter explains how to configure a basic WebLogic Server domain as a WSRP producer. The example in this section assumes that you have a functioning Struts module deployed in a WebLogic Server domain. The goal of this procedure is to create a portlet in a producer that can be consumed remotely.

By following this procedure, you can expose a Struts application as a remote portlet that a WebLogic Portal application can consume, as illustrated in Figure 8-1.

Figure 8-1 WebLogic Server Producer

Description of Figure 8-1 follows
Description of "Figure 8-1 WebLogic Server Producer"

To configure a WebLogic Server domain to be a WSRP producer involves two steps:

8.2 Using WSRP in a Basic WebLogic Server Domain

This section explains how to configure a WebLogic Server domain as a producer. You might do this if you want to make portlets available to consumers, but do not want to install the full WebLogic Portal product on your server.

Tip:

A producer created in this way is a simple producer. A simple producer is a producer that offers core WSRP services without requiring a full WebLogic Portal installation. In this configuration, some advanced features, such as registration and interportlet communication, are not supported. For more information on simple and complex producers, see Section 3.4, "Understanding Producers and Consumers".

The basic steps you need to perform to enable a WebLogic Server domain to be a WSRP producer are:

8.2.1 Create a WebLogic Server Domain

This section explains how to create a new WebLogic Server domain using the Oracle WebLogic Configuration Wizard. You can then extend the domain to include WSRP producer components.

  1. Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd (or config.sh) command in <WEBLOGIC_HOME>/common/bin.

  2. In the Welcome dialog, select Create a new WebLogic domain, and click Next.

  3. In the Select Domain Source dialog, Basic WebLogic Server Domain is selected by default. Leave the other checkboxes unselected, as shown in Figure 8-2.

    Figure 8-2 Select Domain Source

    Description of Figure 8-2 follows
    Description of "Figure 8-2 Select Domain Source"

  4. Complete the rest of the configuration wizard steps to create the WebLogic Server domain. For detailed information on the configuration wizard, refer to Oracle Fusion Middleware Creating Domains Using the Configuration Wizard. See also the Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal.

8.2.2 Extend the WebLogic Server Domain

This section explains how to extend your WebLogic Server domain to include the components of a simple producer.

You extend the domain using an extension template. An extension template defines applications and services that can be used to extend an existing domain. The extension template you will use in this example is called wsrp-simple-producer.jar.

  1. Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd (or config.sh) command in <WEBLOGIC_HOME>/common/bin.

  2. In the Welcome dialog of the configuration wizard, select Extend an existing WebLogic domain, as shown in Figure 8-3, and click Next.

    Figure 8-3 Extend a Domain

    Description of Figure 8-3 follows
    Description of "Figure 8-3 Extend a Domain"

  3. In the Select a WebLogic Domain Directory dialog, navigate to the WebLogic Server domain that you want to extend, select it, as shown in Figure 8-4, and click Next.

    Figure 8-4 Select a Domain Directory

    Description of Figure 8-4 follows
    Description of "Figure 8-4 Select a Domain Directory"

  4. In the Select Extension Source dialog, select Extend my domain using an existing extension template, and click Next.

  5. Click Browse.

  6. In the Select a Template dialog, select the following JAR file, as shown in Figure 8-5:

    <WLPORTAL_HOME>/common/templates/applications/wsrp-simple-producer.jar 
    

    Figure 8-5 Selecting the Template

    Description of Figure 8-5 follows
    Description of "Figure 8-5 Selecting the Template"

  1. Click OK when you have selected the file.

  2. In the configuration wizard, click Next and complete the wizard steps as appropriate. When you reach the last dialog, click Extend.

    Checkpoint: At this point, you have extended the WebLogic Server domain so that it can function as a simple WSRP producer. Next, you need to configure your web projects.

8.3 Configuring a Web Project

After you have a WebLogic Server domain that is configured to function as a WSRP producer, you also need to enable any web projects that you deploy to function as a WSRP producer in the domain. After you configure a web project to function as a WSRP producer, portlets you deploy in that project will be available to consumers.

8.3.1 Create a Web Project

You need to create a web project that is enabled with WSRP producer components. In this example, we demonstrate how to enable a Dynamic Web Project. This type of project does not contain any WebLogic Portal components or WSRP producer components by default.

  1. Open Oracle Enterprise Pack for Eclipse.

  2. Select File > New > Other.

  3. In the New – Select a wizard dialog, open the Web folder and select Dynamic Web Project. The Dynamic Web Project dialog appears.

  4. Enter a name for the project and click Next. The Select Project Facets dialog appears.

  5. In the Configuration section of the dialog, click Modify. The Project Facets dialog appears.

  6. In the Project Facets dialog, expand the WebLogic Portal node, and select only the following facets, as shown in Figure 8-6:

    Figure 8-6 Select Project Facets

    Description of Figure 8-6 follows
    Description of "Figure 8-6 Select Project Facets"

  7. Click Finish.

    Checkpoint: You have created a web project in which you can create portlets that will be visible to consumers.

8.4 Testing the Producer Configuration

To test the producer configuration, you can do the following:

8.4.1 Create a Server on the Producer

If you have not done so, create a WebLogic Server in which to run the application on the producer:

  1. Start Oracle Enterprise Pack for Eclipse.

  2. Select File > New > Other.

  3. In the Select dialog, open the Server folder and select Server.

  4. Follow the wizard prompts to create the server. Use the WebLogic Server domain that you configured to function as a WSRP producer and add the WSRP-producer enabled web project to the server.

  5. Start the server.

    Tip:

    For more information on creating a server using Oracle Enterprise Pack for Eclipse, see Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal.

8.4.2 Test for a Producer WSDL

The first test to perform is to check that the producer web application returns a WSDL description when you enter the WSDL URL in a browser.

  1. Start WebLogic Server.

  2. Enter the WSDL URL for the web project in a browser. For example:

    http://localhost:7001/myWebProj/producer?wsdl

    If the server and web application are configured properly, the WSDL file appears in the browser. Part of a sample WSDL file is shown in Figure 8-7.

    Figure 8-7 Sample WSDL File

    Description of Figure 8-7 follows
    Description of "Figure 8-7 Sample WSDL File"

    Checkpoint: If the WSDL file appears in the browser, then the server is functioning as a producer. You can now create portlets in the web application that can be consumed as remote portlets in consumer applications.

8.4.3 Create a Portlet in the Producer Web Application

You can use Oracle Enterprise Pack for Eclipse to create portlets in the web application on the producer.

For information on creating portlets, see the Oracle Fusion Middleware Portlet Development Guide for Oracle WebLogic Portal.

8.4.4 Consuming a Producer Portlet

Another test you can perform is to try to consume a portlet deployed in the producer from a WebLogic Portal application.

  1. On another machine, create a WebLogic Portal Domain. You can use the WebLogic Configuration Wizard to do this. If you cannot use another machine, be sure the server's listen port does not conflict with the port used by the producer server.

  2. Use Oracle Enterprise Pack for Eclipse to create a Portal Application and associate the application with the new WebLogic Portal Domain. If necessary, you can obtain a free developer's version of Oracle Enterprise Pack for Eclipse by visiting the Oracle web site.

  3. Create a new Portal Web Project to the application. This application is the consumer application.

  4. Create a portal in the consumer application.

  5. Start the server that hosts the consumer.

  6. Create a remote portlet in the Portal Web Project you just created. Point the WSDL to the web application on the producer. For example:

    http://producerHost:producerPort/myWebApp/producer?WSDL
    

    Where producerHost:producerPort is the IP address and port number of the machine hosting the producer, and myWebApp is the name of the context directory for the web application that contains the producer portlet(s) that you wish to surface. See Chapter 4, "Creating Remote Portlets, Pages, and Books" for more information.

  7. On the consumer, add the remote portlet to the portal and open the portal. The portlet you created on the producer appears in the portal.

8.4.5 Summary

In this section you tested a configuration where a remote portlet in a consumer references a portlet that is deployed to a producer running in a basic WebLogic Server domain.

8.5 Disabling a WSRP Producer

To disable a WSRP producer, open the WEB-INF/wsrp-producer-config.xml file and set the <service-config> element's enabled attribute to false. For example:

<?xml version="1.0" encoding="UTF-8"?>
 <wsrp-producer-config
         xmlns="http://www.bea.com/servers/weblogic/wsrp-producer-config/9.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
     <description>
         This configuration file disables the WSRP producer.
     </description>
     <service-config enabled="false">
 ...