Develop > Presentation layer > Work with Web service feeds


Create a custom feed from a Web service

You can customize WebSphere Commerce to retrieve a feed from any existing WebSphere Commerce Web service or from a custom Web service you have created. You can display the feed in a Web widget embedded on a Web site external to WebSphere Commerce. Alternatively, you can let customers subscribe to the feed from the storefront. For example, to offer customers a feed that lists new products from the store, you could create a custom Atom feed from the Get Catalog Web service for the New Products catalog. You can then publish the URL for the feed on the storefront so customers can subscribe to the feed and view the new products in their favorite feed reader. WebSphere Commerce provides a RESTful framework that supports this customization scenario.

Before you begin the customization, understand interactions within the RESTful Web service framework as well as the customization points. Read Overview of the RESTful Web service framework for feeds.

For a tutorial that walks the through these customization steps using a specific example and sample code, see Tutorial: Creating an Atom feed to display recipes in a remote widget.

  1. Define the URL and creating the Java class for the feed
    Using a specific URL structure, define the URL for the RESTful HTTP Get request to retrieve data from the Web service. You must define the URL so that you can use certain data in the URL to create the Java class that supports the feed. When the customization is complete, the URL you define will display the Atom feed if you paste it into a feed reader or browser that supports Atom feeds.

  2. Create the Atom feed representation of the service
    You must create a custom JSP file to format the content of the Atom feed. Each noun must have an associated feed formatting JSP file. The RESTful framework uses this JSP file when converting the SDO to an Atom feed. Register the custom feed formatting JSP file in a Struts configuration file so that the JAX-RS provider Java class uses the correct JSP file to create the feed.

  3. Test, exposing, and deploying the Atom feed
    When you have completed the customization steps, test the Atom feed URL you defined to ensure it displays the feed content as expected. Then implement the means to expose the Atom feed URL to customers so that they can subscribe to the feed in a feed reader or view the content in a Web widget. Finally, deploy the customized code to the production environment.


Related concepts

Remote widgets

Related reference

URL structure for Web service feeds


+

Search Tips   |   Advanced Search