gauravtyagi2777 / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Reciving "The remote server returned an error: (403) Forbidden" - ResponseString "Version 3.0 is not supported" #396

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Request Calendar feed using GData Client v1.6 for .NET via 2-legged OAuth.

What is the expected output? What do you see instead?
The calendar feed (worked with 1.4.x.x)

What version of the product are you using? On what operating system?
v1.6 (from svn) Win32

Please provide any additional information below.
I'm receiving the following error when requesting Calendars 
- ResponseString    "Version 3.0 is not supported." 
Requests for Contacts works ok

Original issue reported on code.google.com by adam.bra...@gmail.com on 28 Jun 2010 at 2:59

GoogleCodeExporter commented 8 years ago
Worked with 1.4.0.2
---snip---
GET 
/calendar/feeds/default/owncalendars/full?xoauth_requestor_id=administrator%40my
company.com.au HTTP/1.1
Content-Type: application/atom+xml; charset=UTF-8
User-Agent: G-MyApp/GOAuthRequestFactory-CS-Version=1.6.0.0
Authorization: OAuth 
oauth_version="1.0",oauth_nonce="417ea090090349eba41dd45a955dbabb",oauth_timesta
mp="1277699622",oauth_consumer_key="mycompany.com.au",oauth_signature_method="HM
AC-SHA1",oauth_signature="QaVAlIDRes%2ULTVNVWLhF46mCxP0%3D"
GData-Version: 3.0
Host: www.google.com
Connection: Keep-Alive

HTTP/1.1 403 Forbidden
Content-Type: text/html; charset=UTF-8
Date: Mon, 28 Jun 2010 04:33:54 GMT
Expires: Mon, 28 Jun 2010 04:33:54 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked

1d
Version 3.0 is not supported.
0
---snip---

Original comment by adam.bra...@gmail.com on 28 Jun 2010 at 4:49

GoogleCodeExporter commented 8 years ago
Somewhere in your code you must be sharing something between contacts & 
calendar. Contacts is actually using V3 - is it possible that you are setting 
both services to use the same requestfactory somewhere in your code?

The calendarservice on it's own should use version 1.0 of the service... 

Original comment by fman...@gmail.com on 28 Jun 2010 at 6:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You're correct! This was working happily until 1.6. Fixed by specifying 
ProtocolMajor version of 2 in the RequestFactory

this.calendarRequestFactory.ConsumerKey = this.oAuthConsumerKey;
this.calendarRequestFactory.ConsumerSecret = this.oAuthConsumerSecret;
this.calendarRequestFactory.ProtocolMajor = 2;

Duh!

Please close this issue.

Thank you.
Sincerely,
Adam

Original comment by adam.bra...@gmail.com on 28 Jun 2010 at 7:33

GoogleCodeExporter commented 8 years ago
Yeah, this worked because the contacts service got a version 3 upgrade.... 

Glad this was it.

Happy coding

Original comment by fman...@gmail.com on 28 Jun 2010 at 7:38