Open-Source Portal Initiative at Sun, Part 4: Web Services for Remote Portlets

By Rajesh Thiagarajan and Marina Sum, May 22, 2007; updated April 2008  

Web Services for Remote Portlets (WSRP), a protocol for aggregating remote content and interactive Web applications, affords an effective means of publishing and consuming remote visual services. That is, instead of presenting data, WSRP shows a view of the data and thus known as a presentation-oriented webservice—as opposed to the traditional data-oriented—Web service. That way, WSRP enables seamless delivery and integration of Web applications or their components, including the presentation layer.

The WSRP Specification is defined by the WSRP Technical Committee at the Organization for the Advancement of Structured Information Standards (OASIS). WSRP features two players:

  • WSRP Producer (henceforth, Producer), a Web service (server) that offers one or more portlets and that implements the interfaces and operations defined in the specification. A Producer can also supply the environment for deploying and managing portlets.
  • WSRP Consumer (henceforth, Consumer), a Web-service client that invokes a Producer and supplies the environment in which users interact with portlets from Producers.

As part of OpenPortal (formerly the Portal Open Source Project), the OpenPortal WSRP Project (henceforth, the WSRP Project) aims to develop a WSRP version that complies with the specification. This article, the fourth in a series, describes the WSRP Project's system and deployment architectures, its build and deployment processes, and the procedure for creating remote portlet windows. This article points you to WSRP version 1.0 implementation and its related resources.

System Architecture
Deployment Architecture
Stable Builds
Deploying OpenPortal WSRP
Using Open Portal WSRP
Build Instructions
System Architecture

The WSRP Project delivers five modules (described below), which are developed over the OpenPortal Portlet Container Project (henceforth, Portlet Container Project), also part of OpenPortal. Figure 1 illustrates the WSRP Project's system architecture.

Figure 1. System Architecture of WSRP Project

The Producer, a Web service based on the Java API for XML Web Services (JAX-WS), implements the interfaces and ports defined in the WSRP version 1.0 Specification. Currently, the Producer is modeled after the Portlet Container, that is, it interacts with the local Portlet Container through the latter's API.

The Producer performs the following tasks:

  1. Enables the creation of Producer Web services.
  2. Enables a Producer Web service to publish local portlets and export them as remote portlets.
  3. Manages consumers and portlets, including their registration. Those tasks are outside the scope of the Portlet Container.
  4. Unmarshals the webservice calls (render or action requests) from the Consumers (see the next subsection) and calls on the local Portlet Container to generate responses. Afterward, marshals the responses and sends them to the Consumers.

The Consumer is an API (Web-service client) that implements the Container API. Correspondingly, the Consumer enables content aggregators and portals to consume remote portlets that are published by the Producer through a uniform interface. In particular—

  • The Portlet Container offers an execution environment for local portlets.
  • The Consumer executes or routes requests to remote Producers, in essence offering an execution environment for remote portlets.

In addition, the Consumer delivers two other capabilities:

  • A Resource Proxy Servlet, which obtains the resources—for example, images and scripts from the Producer—referred to by portlets.
  • User Interfaces for testing  remote portlets by extending the Portlet Container Test Driver (see below), which can be replaced by other aggregators.
WSRP Test Driver

The Portlet Container Test Driver, a test environment for deploying, testing, and debugging local, delegates calls to the Portlet Container through the Container API.

Recall that the Consumer implements the Container API for remote portlets. Accordingly, the WSRP Test Driver is an extension of the Portlet Container Test Driver, where the WSRP Test Driver delegates calls to the Consumer for executing remote portlets.

WSRP Administration Interface

The WSRP Administrative Interface is based on MBeans—clients that you can deploy on MBean servers for managing WSRP components. You can deploy the WSRP Administrative Portlets (see the next subsection), which serve as the UI for these MBeans, on any standard Portlet Container.

Such an architecture spells versatility for recomposing and integrating the WSRP Project into any environment or system to meet your requirements. For example, you can deploy MBeans on an MBean server that manages more services and that is integrated with WSRP.

Specifically, the WSRP Project provides the following MBeans, all of which you can reuse for nondefault system reconfigurations or redeployments:

  • Producer MBeans
    • WSRPProducerManagerMBean
    • WSRPProducerMBean
  • Consumer MBeans
    • ConsumerMBean
    • ConfiguredProducerMBean
      Note: A configured Producer is a Consumer instance that points to a Producer.
    • RemotePortletManagerMBean

Also in the works is a default sample MBeans server that demonstrates the deployment and management of the above MBeans as a separate process on an MBeans server.

WSRP Administrative Portlets

Producer and Consumer Administrative Portlets are the UI for the MBeans mentioned in the preceding subsection. Again, you can deploy them on any standard Portlet Container for execution.

The WSRP Administrative Interface demonstrates the flexibility of using public, exported MBeans in conjunction with the WSRP Project. For example, you can develop a command-line interface (CLI) for the same MBeans and integrate the WSRP Project with systems that require a unified CLI in the Administration Console.

Deployment Architecture

Here is a synopsis of the default deployment architecture of the WSRP Project:

  • The system includes a default MBeans server on which the MBeans developed by the WSRP Project are deployed. That server runs as an independent process.
  • The Producer and the Consumer are deployed on a Web container along with the Portlet Container. You can also deploy the Producer and the Consumer on separate machines. For simplicity, the WSRP Project adopts a single-machine approach.
  • The Administrative Portlets are deployed on any standard Portlet Container that supplies the UI for the deployed MBeans.

Figure 2 illustrates the deployment architecture.

Figure 2. Deployment Architecture
Stable Builds

The builds for the WSRP Project are now available for download. Use the WSRP version 1.0 FCS build if you intent to try the version 1.0 of the implementation, version 2.0 is still under development

Deploying OpenPortal WSRP

Every version of OpenPortal WSRP binary works with particular version of OpenPortal PortletContainer binary the above download page from the WSRP project points to the correct version of the PortletCotainer binary.

Before deploying the WSRP, first deploy the specific OpenPortal PortletContainer binary and deploy few portlets and test your Portlet Container. If all looks good, do the following:

  1. Deploy the WSRP on GlassFish. Type:
    % java -jar wsrp-configurator.jar  
                               GlassFish-install-dir GlassFish-domain-dir
    where GlassFish-install-dir is the location in which you installed GlassFish and GlassFish-domain-dir is GlassFish's domain directory.
    For example:
    • On Windows, type, all on one line:
      java -jar wsrp-configurator.jar c:\glassfish c:\glassfish\domains\domain1
    • On UNIX, type, all on one line:
      % java -jar wsrp-configurator.jar /usr/local/glassfish /usr/local/glassfish/domains/domain1
  2. Restart GlassFish.
  3. Test and deploy portlets at http:// hostname : portnumber /portletdriver/dt, for example, http://localhost:8080/portletdriver/dt.

If the WSRP installation is successful, the portal will show the following:

  • Successful deployment of the Consumer and Producer Administrative Portlets in the Portlets tab.
  • A new, blank WSRP tab, in which the remote portlets are displayed.
Using Open Portal WSRP
Step 1: Creating WSRP Producer

The WSRP Producer Admin portlet provides the necessary GUI for creating and managing WSRP Producers. There exists a default producer called "SampleProducer" which is disabled.

  1. To enable this producer. Edit the producer by clicking on the link.
  2. Publish some portlets i.e move the portlets from "Unpublished Portlets" list to "Published Portlets" list.
  3. Enable the producer.
  4. Click save to save the changes.
Step 2 : Creating WSRP Consumer

You can create a WSRP Consumer by using the WSRP Consumer Admin Portlet. To create a consumer you'd need to have a producer URL. You can choose to use the "SampleProducer" which we created in the above step. To create a consumer

  1. Click "New" on the WSRP Consumer Portlet
  2. Provide the WSRP Producer WSDL URL and click "Get info"
  3. If the producer requires registration, provide the details
  4. Click finish to complete the Consumer creation.
Step 3: Creating Remote/WSRP Portlets.

The WSRP Consumer Admin portlets provides a "Create" link in each of the available Consumers

  1. Click the "Create" to create a channel
  2. Choose a name for the portlet
  3. Choose the remote portlet handle which you want to consumer
  4. Click finish.
Step 4: Viewing Remote/WSRP Portlets

Click the WSRP tab on the portlet container driver to view the remote portlet that we just created.

Build Instructions

This section describes how to build and the WSRP project from source. The procedures apply to the WSRP version 1.0 builds.

Code Download

Subversion (SVN) is the version control tool for the WSRP Project, hence you can browse the source files in the SVN browser on Just anonymously download the code from the WSRP Project's SVN repository:

  1. Type, for example, all on one line:
    % svn checkout wsrp --username guest
    The output looks like this:
    Authentication realm: <https:/> CollabNet SCM Repository
    Password for 'guest':
  2. Press Return at the password prompt.
    The output shows the download in progress:
    A wsrp/producer
    A wsrp/producer/src
    A wsrp/producer/src/java
    . . .

For details, see the WSRP Project's Subversion page.

Note: Write access to the SVN Repository requires that you have the developer role or have become a committer in the WSRP Project. For details, see the guidelines for contributors.

Build Procedure

To build the WSRP:

  1. Install the Apache Maven components with which the WSRP Project uses to build the binary:
  2. Type the following commands to create a binary—a wsrp-configurator.jar file in the wsrp/dist directory:
    % cd wsrp
    % mvn clean package
    % mvn verify
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)