To access remote ColdFusion portlets and expose them as web services using the Web Service Response Protocol (WSRP), configure the following:

  • WSRP Producer: The Web Service Response Protocol (WSRP) is used to create the producer of the WSDL. A WSRP producer can be any ColdFusion instance (Server or JEE).
  • WSRP Consumer: Portlets are exposed as web services, which are then consumed by the portal server (JBoss).

Configure the WSRP producer

  1. Create the ColdFusion HelloPortlet.cfc as described in step 1 of Build a portlet for a local server.
  2. Save the HelloPortlet.cfcfile in the following directory:

    <ColdFusion_webroot>/portlets/hello/

     

  3. Define HelloPortlet.cfc in the cf-wsrp-portlet.xmlfile.

    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    version="1.0">
    <portlet>
    <description xml:lang="en">This Portlet is a Hello World CF Portlet</description>
    <portlet-name>HelloPortlet</portlet-name>
    <display-name xml:lang="en">Hello Portlet</display-name>
    <portlet-class>portlets.hello.HelloPortlet</portlet-class>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>VIEW</portlet-mode>
    <portlet-mode>HELP</portlet-mode>
    </supports>
    <supported-locale>en</supported-locale>
    <portlet-info>
    <title>Hello ColdFusion Portlet</title>
    <short-title>CF Hello</short-title>
    <keywords>hello, portlet</keywords>
    </portlet-info>
    </portlet>
    </portlet-app>

    After updating cf-wsrp-portlet.xml, restart your ColdFusion instance.

Configure the WSRP consumer

  1. Run the JBoss server by running the command: On UNIX{{bin/run.sh}} On Windows{{bin\run.bat}}By default JBoss only binds to localhost. You can have it bind to any IP address by running bin/run.sh -b 0.0.0.0 }}on UNIX or {{bin\run.bat -b 0.0.0.0 on Windows.
  2. Launch the JBoss portal server. By default, JBoss binds to port 8080, so launch the server using the URL: http://localhost:8080/portal/.
  3. Log in to the portal by clicking the login link in the upper-right corner. The default credentials are admin/admin.
  4. Click the Admin option in the upper-right corner.
  5. Click the WSRP tab.
  6. Specify the WSRP consumer name, such as wsrp-test in the Create a Consumer Named box.
  7. Click Create Consumer.
  8. On the next page, specify the WSDL URL of the WSRP producer:http://<WSRPProducer_IP>:<port>/<context_root>/WSRPProducer?wsdl
  9. Click Refresh & Save. If successful, the following message appears"Refresh was successful."

    Note: You can try a demo WSRP consumer hosted by BEA, by entering the WSDL URL: http://wsrp.bea.com:7001/producer/producer?WSDL. After clicking Refresh & Save, the system prompts you to provide the consumerRole registration property. Use the string "public" and click Update Properties. If the BEA WSRP Producer does not get configured, the problem could be with the JBoss Portal Server, rather than the WSRP Producer. Make sure that you are using Java 1.5 JVM.

     

  1. Click the Portlet Definitions tab.
  2. Select wsrp-test from the View portlets provided by the portlet provider named drop-down list.
  3. From the Select the WSRP Portlet You Created box, select the WSRP portlet.
  4. Click View Portlets.
  5. From Actions column, select Create Instance.
  6. Specify the instance name and click Create instance.
  7. Optionally, specify the instance display name and other details.
  8. Go back to Portal Objects and select default. Alternatively, you can create your own portal object.
  9. From the Actions column, select Page Layout.
  10. From the Portal Instance Associated to this Window list, select the WSRP portlet instance you created earlier.
  11. From the Page Layout section, add the instance to the required region by clicking Add.
  12. Go back to the Portal Objects > Portal page.
  13. Click Make Default to make the portal which contains the WSRP portlet as default.
  14. Click the Portal link on the upper-right corner to view the portal page.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy