Documentation

##### WSO2 WSAS 2.2-RC1

- Release Notes
- Contents
- Home

##### Downloads

- Releases

##### Documentation

- User Guide
- FAQs
- Installation Guide
- Source
- Running Behind a Proxy
- Data Services Guide
  - RDBMS Data Source
  - CSV Data Source
  - Excel Data Source
  - JNDI Data Source
- EJB Guide
- Clustering Guide
- JMX Guide
- XKMS Guide
- Changing Keys

##### Samples

- Chad
- Commodity Quote
- Data Services
- Flickr
- Javascript
- Jaxws
- JiBX
- Mtom
- STS
- Trader
- Tiny URL
- Metadata Exchange
- WS-Transfer
- XML Key Managment Specification
- Cluster Management

##### API Documentation

- Java Docs

##### Tools

- Code Generation
- Change Password
- Eclipse IDE Integration
- TCP Monitor
- WSDL2Code
- WSDL View
- Try It
- AAR Validation
- MAR Validation

##### Resources

- News

##### Get Involved

- Mailing Lists
- Integration

##### Project Information

- Project Team
- Issue Tracking
- License

# 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.

    cd WSO2WSAS_HOME\samples\FlickrClient

2. 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

## 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. 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
4. 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:

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.
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.

- read - permission to read private information.
- write - permission to add, edit and delete photo metadata (includes 'read').
- delete - permission to delete photos (includes 'write' and 'read').

## APPENDIX

- WSDL for the FlickrClient - FlickrService.wsdl