Our Odata Webservice bases on XML protocol. Clients invoke webservice via following urls. This webservice is exposed to internet users at address: http://techmaster.dyndns.biz/SocialPhotos. The local address of server is 192.168.1.99

Here are methods and urls can be used:

 

Prototype 

Url 

Purpose

[WebGet]

public void like(int id); 

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/like?id=1

Say that I like this photo. This invoking action will increase Like value of photoId.

[WebGet]

public void dislike(int id); 

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/dislike?id=1

Say that I dislike this photo. This invoking action will increase Dislike value of photoId.

[WebGet]
public IQueryable<Photo> getTodayPhotos();

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getTodayPhotos

Get today uploaded photos

[WebGet]
public IQueryable<Photo> getPhotosByCategoryID(int id) ;

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getPhotosByCategoryId?id=2

Get photos belonging to a category

[WebGet]
public IQueryable<Photo> getPhotosByUserID(int id) ;

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getPhotosByUserId?id=2

Get photos uploaded by a specific user

 

http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/Photos

Get XML description of all photos.

 

http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/Photos(photoId)

Get XML description of a photo.

 

http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/Photos(photoId)/$value

GET MLE of a photo

 

http://localhost/SocialPhotos/Upload.ashx?f=fileName

Get a photo directly from a url (just like browser)

 

http://localhost/SocialPhotos/Thumbnail.ashx?f= fileName

Get the thumbnail of a photo

 

http://techmaster.dyndns.biz/SocialPhotos/

View and upload photos via web protocol

 

http://techmaster.dyndns.biz/SocialPhotos/Upload.ashx

This is url for uploading by POST method.

If you need add location of photos, you can add field "longitude" and "latitude" to data.

[WebGet]

public IQueryable<Photo> getRandomPhotos(int number);

http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getRandomPhotos?number=6

Get 6 random photos

 

 http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getTopRated?number=3

Get top [number] rated photos

  http://techmaster.dyndns.biz/SocialPhotos/Comment.ashx

Post comment for a photos. Http method should be POST. Data includes following fields: userId, photoId, comment.

If you get any difficulity to post comments, please take a glance at my simple webservice consumer written in windows form.

 

   http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/Comments?$filter=Photo/Id eq 19$orderby=PostedTime Get comments of a photo that has Id = 19

 

 

 

       

 

 


Last edited Oct 16, 2011 at 8:15 AM by nguyenhoangha, version 25

Comments

No comments yet.