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] |
http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getTodayPhotos |
Get today uploaded photos |
[WebGet] |
http://techmaster.dyndns.biz/SocialPhotos/PhotoCloud.svc/getPhotosByCategoryId?id=2 |
Get photos belonging to a category |
[WebGet] |
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 |
|
Get a photo directly from a url (just like browser) |
|
|
Get the thumbnail of a photo |
|
|
View and upload photos via web protocol |
|
|
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 |