This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145019 - [saas][flickr] flickr.photos.set* should do POST properly
Summary: [saas][flickr] flickr.photos.set* should do POST properly
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Manager (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Ayub Khan
URL: http://www.flickr.com/services/api/fl...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-25 15:21 UTC by Lukas Jungmann
Modified: 2008-08-30 14:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
TCP dump (1.56 KB, text/plain)
2008-08-25 15:29 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-08-25 15:21:55 UTC
although docs for flickr.photos.setTags is saying that one should do HTTP POST request doing it returns:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
        <err code="112" msg="Method &quot;flickr.photos.setTagsflickr.photos.setTags&quot; not found" />
</rsp>

method works fine if one does HTTP GET instead
Comment 1 Lukas Jungmann 2008-08-25 15:29:35 UTC
Created attachment 68253 [details]
TCP dump
Comment 2 Peter Liu 2008-08-26 00:44:37 UTC
I changed the method type for setTags to GET.

Comment 3 Quality Engineering 2008-08-26 06:04:13 UTC
Integrated into 'main-golden', available in build *200808260201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/1032ff8774b4
User: PeterTLiu@netbeans.org
Log: Fix for IZ #145019.
Comment 4 Lukas Jungmann 2008-08-27 13:15:38 UTC
well, doing get is just a workaround for this so instead of changing request type of all set methods for all services
which do require HTTP POST it would be better to fix POST request we're doing...

As can be seen from a tcp dump I already attached:

POST
/services/rest?api_key=7b067a62dcecdb6316316363a4bb9f61&photo_id=2789422804&tags=myAppTag3&method=flickr.photos.setTags&auth_token=72157604346256405-a3fb1c26c337fad9&api_sig=dc66fb6dc0464d3091db0e5a64e358b1
...
 ?api_key=7b067a62dcecdb6316316363a4bb9f61&photo_id=2789422804&tags=myAppTag3&method=flickr.photos.setTags&auth_token=72157604346256405-a3fb1c26c337fad9&api_sig=dc66fb6dc0464d3091db0e5a64e358b1

is, IMO, wrong HTTP POST request, correct one should be:

POST /services/rest
...
?api_key=7b067a62dcecdb6316316363a4bb9f61&photo_id=2789422804&tags=myAppTag3&method=flickr.photos.setTags&auth_token=72157604346256405-a3fb1c26c337fad9&api_sig=dc66fb6dc0464d3091db0e5a64e358b1

Another issue here seems to be that in case of post request our api_sig is incorrect (I'm getting error 100 from
flickr). I've found some useful answers about Flickr & POST at: http://www.flickr.com/groups/api/discuss/72157603810370933/
Comment 5 Quality Engineering 2008-08-28 06:25:19 UTC
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/0310760d4556
User: PeterTLiu@netbeans.org
Log: Fix for IZ #145019 (for java apps)
Comment 6 Peter Liu 2008-08-28 21:21:51 UTC
Reassigning to Ayub since he is now working on the fix.
Comment 7 Lukas Jungmann 2008-08-28 22:33:23 UTC
ooops - just for the record - I've made a mistake in how the POST should look like - there must not be leading '?' on
the line with request parameters, so correct format of the request is:

POST /services/rest
<request_headers>
<empty_line>
api_key=7b...1&photo_id=2...4&tags=myAppTag3&method=flickr.photos.setTags&auth_token=7...d9&api_sig=d...1
<empty_line>
<empty_line>

Sorry for that.
Comment 8 Ayub Khan 2008-08-28 23:49:30 UTC
Fixed.
Comment 9 Quality Engineering 2008-08-30 05:31:06 UTC
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/07edd2a9e155
User: Ayub Khan <ayubskhan@netbeans.org>
Log: Fix issue#145019 - [saas][flickr] flickr.photos.set* should do POST properly
Comment 10 Lukas Jungmann 2008-08-30 14:31:14 UTC
v.