Welcome!

Java Authors: Maureen O'Gara, Liz McMillan, Walter H. Pinson, III, Yakov Werde, Tony Bishop

Related Topics: Java

Java: Article

WSRP Really Works!

How two competing portal server products can integrate with one another

For simplicity's sake, I've created two JSR-168 portlets, which you can download at the end of the article:

  • BEA Java Portlet - Echoes back a message entered into a text field by the user when the user clicks the Update Message button.
  • IBM Java Portlet - Allows the user to input addresses, edit addresses, delete addresses, and list addresses. To reduce the complexity of the portlet, the application doesn't persist the information to a database, but instead stores the information in memory.
I deployed BEA Java Portlet, which is contained inside of the BEAPortalEAR.ear file, to WebLogic Portal. I deployed IBM Java Portlet, which is contained inside of the IBMPortletWeb.war, to WebSphere Portal. I'll be using both of these portlets throughout the tutorials to demonstrate WSRP.

Scenario 1: WebLogic Portal Acts as a Consumer and WebSphere Portal Acts as a Producer
For WebLogic Portal to consume a WebSphere Portal portlet, several things need to happen:

  • WebSphere Portal
  • Functions as a producer
  • Offers (shares) the portlet
  • WebLogic Portal
  • Functions as a consumer
  • Adds a producer
  • Creates a remote portlet
  • Adds the remote portlet to a page
Fortunately for us, WebSphere Portal and WebLogic Portal both function as consumers and producers without requiring any special setup. However, the other steps still need to be performed.

Note that if security is enabled on the producer, the producer must also provide the consumer with additional information, including the security setup of the producer portal. Security is outside the scope of this article.

WebSphere Portal - Offer a Portlet
Log onto WebSphere Portal (e.g., http://portalpc:10038/wps/portal). Click the Launch button and select Administration to navigate to the WebSphere Portal Administration Console. (Notice that the URL is in the format http://hostname:port/wps_context_root/wps_default_home.)

Click the Portlets node underneath Portlet Management in the navigation bar.

Search for the portlet that you want to share using the Manage Portlets administration portlet. Click the first icon (Provide Portlets) to the right of IBM Java Portlet.

Click OK when asked whether or not you want to provide IBM Java Portlet as a Web Service. A checkmark will appear in the Provided column and a success message will appear at the top of the Manage Portlets portlet.

If you want to see a list of all the provided offered portlets, select All provided portlets from the Search by drop-down menu and click Search.

Should you decide in the future that you no longer want to share this portlet, you can click on the icon again. Notice that the icon now has a line drawn through it and is labeled Withdraw Portlet. If you perform this action, the checkmark in the Provided column will disappear.

Congratulations! That's all there is to sharing a portlet. Now it's on to configuring the consumer.

WebLogic Portal - Add a Producer
Log onto the WebLogic Portal Administration Console for the portal EAR project that you've deployed (e.g., http://localhost:7001/BEAPortalEARAdmin) and click Portal Management. (Notice that the URL is in the format (http://hostname:port/ear_nameAdmin.)

Expand Portal Resources and then click on the Library node in the navigation bar. WebLogic Portal will display a listing of the all the different types of components that you can use in your portal, including portlets and pages. Also, listed there is a node called Remote Producers. Click on Remote Producers.

Next, click on the Add Producer button. A wizard will open that steps you through the process of adding a producer. Keep in mind that adding a producer means that WebLogic Portal is simply "discovering" a producer so it can "consume" its portlets.

The first step in the process is the most critical. Enter the Producer WSDL URL. This URL points to the WSDL document that contains information about the producer and how to connect to its services. Specifically, it contains the URLs of the WSRP interfaces supported by the provider. This includes the two mandatory service interfaces mentioned earlier (i.e., service description and markup) as well as any optional interfaces provided by that service. In the case of WebSphere Portal, the standard format for this URL is:

http://producer_portal_host:producer_port/wps_context_root/wsdl/wsrp_ser...

In our case, this URL translates to:

http://portalpc:10038/wps/wsdl/wsrp_service.wsdl.

Enter this URL.

Now that you've input the URL, click the Search button. A single producer should be located. Select the producer from the results list. Before proceeding to the next step of the wizard, check the checkbox View producer's available portlets before adding producer. This will let you view the producer-offered portlets in step 2 of the wizard; otherwise, the wizard will skip step 2.

Click Next. In our case, a single portlet should be displayed that corresponds with IBMJavaPortlet.

Click Next. Now it's time to enter the producer properties that will be stored on the consumer side. The only item that you're required to input is the Producer Name (Handle). Input IBM WebSphere Portal Server v6.0. Optionally, you can input a vendor and a description.

Click Next. Notice that the wizard skips step 4, the registration step. Remember that IBM WebSphere Portal doesn't support the registration interface, since it's optional. (See Figure 2)

Click Finish to create the remote producer. The remote producer will be displayed inside the Browse Remote Producers table. There is a Test Connection button that you can click on to make sure that WebLogic Portal can communicate with WebSphere Portal. However, if it couldn't, you would have gotten an error message during the first step of the wizard.


More Stories By Matt Silver

Matt Silver is a courseware developer and trainer, currently serving as a senior consultant for Web Age Solutions.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
ambujsaxena 08/26/08 05:57:01 AM EDT

Hi Matt,

I have some problem with retrieving the producer, when i am entering the wsdl of my service(https) which is in WSRP and hosted on IIS, then its saying unable to retrieve producer.
And if i try the same in IE its getting the wsdl, now can you tell me where i am missing the configuration settings in WebLogic9.2.