I found my problem... sorry about not posting it.

It turns out that whatever you pass to the function I was using
(service.RetrieveUser()) had to be a string. I'm not proficient enough
in Python to know what I was actually passing it, but a simple
solution worked:

service.RetrieveUser(string([[ whatever you pull from another
variable ]]))

Worked like a charm... let me know if it works for you, too.

On Oct 15, 8:36 pm, Jose Ignacio Naranjo
<[EMAIL PROTECTED]> wrote:
> I am also having the same kind of problem, but with gcalendar API.
>
> In my case, the SDK tells me that the error is an invalid protocol.
> ERROR    2008-10-16 03:10:53,630 urlfetch_stub.py] Invalid protocol:
>
> Looking at the traceback I realized that the problem could be here:
> new_event = self.gcal.InsertEvent(event, '/calendar/feeds/' + id_cal +
> '/private/full')
> so, I changed the url of the calendar addding 'http://google.com/...'
>
> Then, the error became to this other one:
>
>   File "/home/jor/google_apps/gbeep/core/gcalendar.py", line 53, in
> _InsertEvent
>     new_event = self.gcal.InsertEvent(event, 'http://google.com/
> calendar/feeds/' + id_cal + '/private/full')
>   File "/home/jor/google_apps/gbeep/gdata/calendar/service.py", line
> 149, in InsertEvent
>     converter=gdata.calendar.CalendarEventEntryFromString)
>   File "/home/jor/google_apps/gbeep/core/gdata/service.py", line 831,
> in Post
>     media_source=media_source, converter=converter)
>   File "/home/jor/google_apps/gbeep/core/gdata/service.py", line 951,
> in PostOrPut
>     'reason': server_response.reason, 'body': result_body}
> RequestError: {'status': 405, 'body': '...<H1>Method Not Allowed</H1>
> \nThe request method <code>POST</code> is inappropriate for the URL
> <code>/calendar/feeds/[EMAIL PROTECTED]/private/
> full</code>..., 'reason': ''}
>
> Creations usually are done by POSTs, and looking at the gcalendar code
> InsertEvent sends an (obvious) POST, so probably I have misunderstood
> something, cause the POST is ok! Well, surely I should rest some time,
> and try again :).
>
> Till yesterday, I used the default private calendar, and I hadn't any
> problem using the url '/calendar/feeds/private...' (no invalid
> protocol failure), the problem is happening from the change to use non-
> default calendars.
>
> Thanks for your help! :)
>
> On Sep 29, 7:12 pm, "Anirudh (Google)" <[EMAIL PROTECTED]> wrote:
>
> > Hi Sam,
>
> > I went through AppEngine URLFetch API code to figure out the error you
> > are 
> > getting:http://code.google.com/p/googleappengine/source/browse/trunk/google/a...
>
> > It looks like the possible causes of the error is either an
> > unsupported protocol or a malformed URL.
> > Since URLFetch API allows https ( used by Provisioning API ),
> > malformed URL most likely is the possible 
> > cause:http://code.google.com/appengine/docs/urlfetch/exceptions.html#Invali...
>
> > Is the error encountered both in AppEngine local SDK and live
> > deployment?
> > Also, to isolate the problem, can you please try fetching the admin
> > user itself that you used to create the service instance ?
>
> > -Anirudh
>
> > On Sep 29, 8:28 pm, Met Sacramento <[EMAIL PROTECTED]> wrote:
>
> > > Bump. I need some help here...
>
> > > On Sep 26, 3:25 pm, Met Sacramento <[EMAIL PROTECTED]> wrote:
>
> > > > Already did that.
>
> > > > I'm sending the right username - that's not the problem. I'm also not
> > > > passing anything other than English letters in the URL.
>
> > > > Here's what I'm asking: What does "InvalidURLError: ApplicationError:
> > > > 1" mean?
>
> > > > Sam
>
> > > > On Sep 26, 2:42 pm, "Patricia Goldweic" <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > I suggest that you carefully debug your code, particularly by 
> > > > > printing out
> > > > > the complete username string that you construct by grabbing the 
> > > > > different
> > > > > pieces.  Only then you can be sure that you're sending the right 
> > > > > username to
> > > > > Google.
>
> > > > > -Patricia
>
> > > > > > -----Original Message-----
> > > > > > From: [email protected]
> > > > > > [mailto:[EMAIL PROTECTED] On Behalf Of Met Sacramento
> > > > > > Sent: Friday, September 26, 2008 12:39 PM
> > > > > > To: Google Apps APIs
> > > > > > Subject: [google-apps-apis] Problem with Provisioning API
>
> > > > > > Hey GAFYD Group...
>
> > > > > > I'm having some problems with the provisioning API. I'm
> > > > > > trying to retrieve a user by a username submitted via GET/POST.
>
> > > > > > When I explicitly pass the service.RetrieveUser() the
> > > > > > username, it works fine. When I pass it a variable (i.e.
> > > > > > self.request.get("username")... I'm using this on AppEngine),
> > > > > > it gives me the following stacktrace:
>
> > > > > > Traceback (most recent call last):
> > > > > >   File "C:\Documents and Settings\setup\workspace\Google
> > > > > > AppEngine \google\appengine\ext\webapp\__init__.py", line
> > > > > > 496, in __call__
> > > > > >     handler.get(*groups)
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \resetpass.py", line 42, in get
> > > > > >     self.response.out.write(service.RetrieveUser(username))
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \gdata\apps\service.py", line 357, in RetrieveUser
> > > > > >     return gdata.apps.UserEntryFromString(str(self.Get(uri)))
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \gdata\service.py", line 665, in Get
> > > > > >     headers=extra_headers)
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \atom\service.py", line 163, in request
> > > > > >     data=data, headers=all_headers)
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \atom\http_interface.py", line 148, in perform_request
> > > > > >     return http_client.request(operation, url, data=data,
> > > > > > headers=headers)
> > > > > >   File "C:\Documents and Settings\setup\workspace\PasswordReset\src
> > > > > > \gdata\alt\appengine.py", line 123, in request
> > > > > >     method=method, headers=all_headers))
> > > > > >   File "C:\Documents and Settings\setup\workspace\Google
> > > > > > AppEngine \google\appengine\api\urlfetch.py", line 257, in fetch
> > > > > >     raise InvalidURLError(str(e))
> > > > > > InvalidURLError: ApplicationError: 1
>
> > > > > > What does this mean? Here is the code:
>
> > > > > > service = gdata.apps.service.AppsService(email="[EMAIL PROTECTED]",
> > > > > > domain="DOMAIN.org", password="PASSWORD")
> > > > > >                 gdata.alt.appengine.run_on_appengine(service)
> > > > > >                 service.ProgrammaticLogin()
> > > > > >                 username = 
> > > > > > string.lower(self.request.get("firstname"))
> > > > > > + "-" + string.lower(self.request.get("lastname"))
> > > > > >                 self.response.out.write(username)
> > > > > >                 userobj = False
>
> > > > > > self.response.out.write(service.RetrieveUser(username))
>
> > > > > > You can see that I piece together the username (in the format
> > > > > > firstname-lastname) and create the username variable, from
> > > > > > GET variables "firstname" and "lastname".
>
> > > > > > Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to