Accessing the installed Feed Samples
Use this topic to access the installed feed samples for Atom and RSS feeds and the Atom Publishing Protocol (APP) service.
Samples for Atom and RSS feeds
The Atom and RSS feeds are available at the following default URLs:
http://servername:port/contextroot/rest/atom and
http://servername:port/contextroot/rest/rss respectively.
An example URL is
http://localhost:9080/SampleFeedApp_Wink/rest/atom. Use the following
options to test the support to read and write RSS and Atom content.
- Open a browser, and navigate to http://localhost:9080/SampleFeedApp_Wink/.
A single page is displayed, where you can view the samples related to Atom and RSS
feeds support.
- Alternately, manually enter the following URLs in the browser
window to test the Atom and RSS support samples:
- http://localhost:9080/SampleFeedApp_Wink/rest/atom : Generates an Atom feed
- http://localhost:9080/SampleFeedApp_Wink/rest/atom/read?url=http://www.atomenabled.org/atom.xml :
Reads an example Atom feed
- http://localhost:9080/SampleFeedApp_Wink/rest/rss : Generates an RSS feed
- http://localhost:9080/SampleFeedApp_Wink/rest/rss/read?url=http://www.alphaworks.ibm.com/news/xml/aw.xml :
Reads an example RSS feed
Important: The default port for WebSphere® Application Server Community Edition 2.x is 8080.
Samples for Atom Publishing Protocol (APP)
The APP service is available at the URL, http://localhost:9080/SampleFeedApp_Wink/rest/app.
The APP samples require HTTP operations to work with the feed entries; for example:
- HTTP POST is used to create an entry in a feed.
- HTTP PUT is used to update a specific entry in a feed.
- HTTP GET is used to retrieve a specific entry from a feed,
the entire feed, or the APP service document.
- HTTP DELETE is used to delete a specific entry from a feed.
There are two options to perform these operations on the feed, and view
the results:
- Use XMLHttpRequest (XHR) object in the browser to perform the
PUT, POST, GET, DELETE operations. The normal form submit operation in
the browser supports only the GET and POST operations. The current
sample application does not use the XHR option to demonstrate
the use of APP
- The other, simpler, approach is to use a tool such as cURL
(http://curl.haxx.se/download.html). cURL provides a simple command-line operation to invoke calls on the APP server. This option is available to test the APP samples.
The cURL options to work with the APP sample are listed below. To
perform a create (POST) or an update(PUT) entry operation, the entry
content is passed using an
entry.xml
document. The content of this document is shown in the following example:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>eclifox</id>
<title type="text">Eclipse on the browser</title>
<author>
<name>IBM User 1</name>
</author>
<updated>2007-10-16T18:05:46.469Z</updated>
<summary type="text">An Eclipse plug-in that enables browser-based access to Eclipse.</summary>
</entry>
The entry.xml file
contains a new entry definition with the basic entry ID,
title, author, and summary.
Important:
Before you run cURL or view the samples in the
browser complete the following actions:
- The server name and port, used in this example is
http://localhost:9080/. Change this to a value that is relevant to your
server.
- The following commands refer to an {entry_id}. The entry_id is
within the id tag: <id>entry_id</id>
Now, you are ready to run the cURL commands. Alternately, you can also run the GET
operations by opening the URL in a browser.
These are explained for every GET command.
- Retrieve the APP service document using:
- Retrieve the entire feed, using GET:
- Retrieve a specific feed entry, using GET:
- Create an entry, using POST:
- Update a specific entry, using PUT:
- Remove an entry, using DELETE:
Important: The host name, servlet port and context root are documented as 'localhost', '9080' and 'SampleFeedApp_Wink'. This might vary according to the server configuration.
Troubleshooting
PUT and DELETE methods do not work
- The PUT method updates a specific entry, and the DELETE method
discards a specific entry. To work with this specific entry, ensure
that the {entry_id} being used already exists in the feed. Perform a
GET operation prior to the PUT or DELETE operation, and verify that the
{entry_id} exists. The entry_id is within the id tag:
<id>entry_id</id>
- In the case of PUT, ensure that the entry_id being used in the
URL is similar to the one being entered into the sample entry.xml file.
- The POST operation always returns with the
details of the created entry, including its entry_id information. In
case of a subsequent update to this entry, use this entry_id.
Certain feeds are not being read by the Wink libraries
Current Java 2 Security policy reported a potential violation
of Java 2 Security Permission
- If you see this error in your SystemOut log, notice that this
is a setting that needs to be applied or changed based on the
documentation in the IBM WebSphere Application Server Information Center.
Specifically, refer to http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/csec_rsecmgr2.html
- If you do not want this security setting enabled, you can disable it using the following steps:
- Open the IBM® WebSphere Application Server administrative console, and
expand the Security option. Select Secure administration,
applications, and infrastructure.
- On this "Secure administration, applications, and
infrastructure" configuration page, clear the Use Java 2 security
to restrict application access to local resources option. Click
Apply.
- Click Save to the master configuration.
- Restart "server1".