FlickrClient Sample Guide

INTRODUCTION

We will use this sample to demonstrate the capabilities of WSO2 WSAS in terms of its ability to genarate code for a WSDL 2.0 description and its ability to invoke a real world application RESTfully. The WSDL 2.0 description found here describes the REST API of Flickr via the HTTPBinding of WSDL 2.0 . The Client provided in the sample uses a stub which is dynamically genarated by WSAS.

HOW TO BUILD AND RUN THE SAMPLE

FlickrClient sample is in WSO2WSAS_HOME|samples|FlickrClient.

To build the samples you need Apache Ant build tool.

Now follow these simple instructions:

  1. Switch to the FlickrClient directory, e.g.
  2. cd WSO2WSAS_HOME\samples\FlickrClient
  3. From there simply type

    ant
    The build dynamically genarates a stub using the WSDL 2.0 description and opens the Client up for you. Now your ready to play around with Flickr

    Startup screen


Interacting with Flickr:

  1. You will need to provide an API key obtained from Flickr in order to continue. The API key will be used for subsequent invovations of the Flickr API. If you do not have have an API key you can apply for one from http://www.flickr.com/services/api/keys/apply/
  2. The application can be configured using the configure menu. The properties that can be configured are:
    • Host - Can be used to change the host address the request are sent to (Usefull if you want to track the wire messages uses a tracking tool. e.g tcp monitor).
    • Port - Can be used to change the port the request are sent to (Usefull if you want to track the wire messages uses a tracking tool. e.g tcp monitor).
    • API KEY - Used to change the API KEY provided.
    • Secret - Used to chage the shared secret provided.

  3. Configure Client

  4. Each main tab in the appilication corresponds to a category of methods specified in the Flickr API. For e.g The people tab corresponds to the people category while the PhotoSetsComments tab corresponds to the photosets.comments category
  5. Each sub tab in the appilication corresponds to a single method specified in the Flickr API under the main category. For e.g The FindByEmail tab corresponds to the flickr.people.findByEmail method defined under the people category while the PhotoSetsComments tab corresponds to the photosets.comments category

Flickr Authentication:

  1. Many methods in Flickr require the user to be logged in. Therefore when such a method is accessed the application when show you the following dialog box.

    Authentication Dialog

    If you click ok the application will try to authenticate you using the Flickr Authentication API If the user is not currently logged in to flickr, they are first asked to do so and grant permission to the application. The application will fire your default browser so that you can grant permission to the application. The application always request only the permissions that it needs to fulfill a particullar request. Therefore if the application does not have sufficient permissions once another operation is attempted it may require you to grant permissions again. There are three levels of permissions.

    Confirmation of Authentication

    APPENDIX