Skip navigation.
Downloads | Product Documentation | Support

Using WSRP with WebLogic Portal

# Best Practices for Implementing WSRP

This section describes programming and tuning practices that you should follow to ensure the best performance of your WSRP-compliant portlets, Producers, and Consumers. It contains the following guidelines:

- Portlet Programming Guidelines
- Performance Tuning Recommendations

# Portlet Programming Guidelines

Please follow these guidelines when programming WSRP-compliant portlets:

- Requests and Sessions

- Don't rely on request attributes across portlets
- If your portlets share a session, host them on the same Producer

- Security

- To secure messages, implement SSL on any port through which the Producer will be offered.
- Specify "true" for all secure attributes in the <service-config> element of the Producer project's `WEB-INF/wsrp-producer-config.xml` file (for more information, please refer to Establishing WSRP Security).

Note: If you make any changes to `wsrp-producer-config.xml`, you will need to redeploy or bounce the server before the changes become active.

- To manage user identity, rely on single-sign-on (SSO), which is set up by default in WebLogic Portal and then have users login to the Consumer portal. WebLogic Portal will manage SSO automatically.

- URLs

- When creating URLs in a portlet, do not create use direct links; instead use WebLogic Portal tags and APIs to create URLs

- Look and Feel

- Let portlets use standard style attributes and specify those attributes on the Portal skins

# Performance Tuning Recommendations

To ensure optimal performance of your Producers and Consumers, we recommend the following performance tuning guidelines:

- On the Producer side

- Enable attachment support by adding `<markup transport="attachment"/> to WEB-INF/wsrp-producer-config.xml`, as shown in Listing 3-1.

Listing 3-1 Enabling Attachment Support

>     <?xml version="1.0" encoding="UTF-8"?>
>     wsrp-producer-config
>         xmlns="http://www.bea.com/servers/weblogic/wsrp-producer-config/8.0"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.bea.com/servers/weblogic/wsrp-producer-config/8.0
>     wsrp-producer-cnfig.xsd">

>         <service-config>
>             <registration required="false" secure="true"/>
>             <service-description secure="true"/>
>             <markup secure="true" rewrite-urls="true" transport="attachment"/>
>             <portlet-management required="false" secure="true"/>
>         </service-config>

- Let the Producer create correct URLs by using Consumer-supplied URL templates. This is the default practice.

- On the Consumer side

- Accept the default behavior to enable caching for proxy portlets.
- Enable forked rendering for proxy portlets.
- Set connection timeout by adding `<connection-timeout>``120000``</connection-timeout>` to `WEB-INF/wsrp-producer-registry.xml`, as shown in Listing 3-2.``

Listing 3-2 Setting the Connection Timeout

>     <?xml version="1.0" encoding="UTF-8"?>
>     <wsrp-producer-registry
>     xmlns="http://www.bea.com/servers/weblogic/wsrp-producer-registry/8.0"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

>     xsi:schemaLocation="http://www.bea.com/servers/weblogic/wsrp-producer-registry/8.0
>     wsrp-producer
>     -registry.xsd">

>          <!-- Upload limit (in bytes) -->
>          <upload-read-limit>1048576</upload-read-limit>

>          <!-- Timeout (in milli seconds) -->
>          <connection-timeout-secs>120000</connection-timeout-secs>

Note: 120000—in milliseconds—is a suggested timeout period. Your needs might require a longer or shorted timeout.

- Disable logging

- Undeploy MessageMonitor servlet from `WEB-INF/web.xml.`

# Other Guidelines

User sessions on Consumer web applications might be lost if session cookies between Producers and Consumers overlap. To prevent this, open `weblogic.xml` and configure your web applications to include the domain name and web application path for session cookies. Please refer to session-descriptor in weblogic.xml Deployment Descriptor Elements at:

>     http://e-docs.bea.com/wls/docs81/webapp/weblogic_xml.html#1038173

for details on how to set the domain name and path.