I understood how to delete an event using OAuth.

Source--------------------------------------------------
String eventId = URLDecoder.decode(entry.getId().substring
(52),"UTF-8");
deleteUrl = new URL(BASE_FEED_OAUTH + "default/private/full/" +
eventId + "?xoauth_requestor_id=" + user);
service.getRequestFactory().setHeader("If-Match", "*");
service.delete(deleteUrl);
--------------------------------------------------------

But We must be careful.
We cannot use this service for the making of the event.

Please make service newly if I want to make an event.



On 12月11日, 午後2:16, caramac <[email protected]> wrote:
> I tried to delete an event usingOAuth.
> The pattern that I tried is as follows.
>
> ●Pattern 1
> ------
> Source------------------------------------------------------------------------------
> URL deleteUrl = new URL(entry.getEditLink().getHref());
> service.delete(deleteUrl);
>
> ------
> Error----------------------------------------------------------------------------------
> 2009/12/11 4:55:27 org.apache.commons.httpclient.HttpMethodDirector
> processWWWAuthChallenge
> 警告: Unable to respond to any of these challenges:
> {googlelogin=GoogleLogin realm="https://www.google.com/accounts/
> ClientLogin", service="cl"}
> com.google.gdata.util.AuthenticationException: OK
> <HTML>
> <HEAD>
> <TITLE>Unknown authorization header</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Unknown authorization header</H1>
> <H2>Error 401</H2>
> </BODY>
> </HTML>
>
>         at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse
> (HttpGDataRequest.java:564)
>         at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse
> (GoogleGDataRequest.java:543)
>         at com.google.gdata.client.http.HttpGDataRequest.checkResponse
> (HttpGDataRequest.java:536)
>         at com.google.gdata.client.http.HttpGDataRequest.execute
> (HttpGDataRequest.java:515)
>         at com.google.gdata.client.http.GoogleGDataRequest.execute
> (GoogleGDataRequest.java:515)
>         at com.google.gdata.client.Service.delete(Service.java:1560)
>         at com.google.gdata.client.GoogleService.delete(GoogleService.java:
> 691)
>         at com.google.gdata.client.Service.delete(Service.java:1522)
>         at com.google.gdata.client.GoogleService.delete(GoogleService.java:
> 676)
>         .........
> ----------------------------------------------------------------------------------------------
>
> ●Pattern 2
> ------
> Source------------------------------------------------------------------------------
> entry.delete();
>
> ------
> Error----------------------------------------------------------------------------------
> 2009/12/11 4:57:30 org.apache.commons.httpclient.HttpMethodDirector
> processWWWAuthChallenge
> 警告: Unable to respond to any of these challenges:
> {googlelogin=GoogleLogin realm="https://www.google.com/accounts/
> ClientLogin", service="cl"}
> com.google.gdata.util.AuthenticationException: OK
> <HTML>
> <HEAD>
> <TITLE>Unknown authorization header</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Unknown authorization header</H1>
> <H2>Error 401</H2>
> </BODY>
> </HTML>
>
>         at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse
> (HttpGDataRequest.java:564)
>         at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse
> (GoogleGDataRequest.java:543)
>         at com.google.gdata.client.http.HttpGDataRequest.checkResponse
> (HttpGDataRequest.java:536)
>         at com.google.gdata.client.http.HttpGDataRequest.execute
> (HttpGDataRequest.java:515)
>         at com.google.gdata.client.http.GoogleGDataRequest.execute
> (GoogleGDataRequest.java:515)
>         at com.google.gdata.client.Service.delete(Service.java:1560)
>         at com.google.gdata.client.GoogleService.delete(GoogleService.java:
> 691)
>         at com.google.gdata.data.BaseEntry.delete(BaseEntry.java:638)
>         .........
> ----------------------------------------------------------------------------------------------
>
> ●Pattern 3
> ------
> Source------------------------------------------------------------------------------
> String BASE_FEED_OAUTH = "http://www.google.com/calendar/feeds/";;
> String eventId = URLDecoder.decode(entry.getId().substring
> (52),"UTF-8");
>
> deleteUrl = new URL(BASE_FEED_OAUTH + eventId + "/private/events" + "?
> [email protected]");
> service.delete(deleteUrl);
>
> ------
> Error----------------------------------------------------------------------------------
> 2009/12/11 5:07:01 org.apache.commons.httpclient.HttpMethodBase
> getResponseBody
> 警告: Going to buffer response body of large or unknown size. Using
> getResponseBodyAsStream instead is recommended.
> com.google.gdata.util.ServiceForbiddenException: OK
> If-Match or If-None-Match header required
>
>         at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse
> (HttpGDataRequest.java:561)
>         at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse
> (GoogleGDataRequest.java:543)
>         at com.google.gdata.client.http.HttpGDataRequest.checkResponse
> (HttpGDataRequest.java:536)
>         at com.google.gdata.client.http.HttpGDataRequest.execute
> (HttpGDataRequest.java:515)
>         at com.google.gdata.client.http.GoogleGDataRequest.execute
> (GoogleGDataRequest.java:515)
>         at com.google.gdata.client.Service.delete(Service.java:1560)
>         at com.google.gdata.client.GoogleService.delete(GoogleService.java:
> 699)
>         at com.google.gdata.client.Service.delete(Service.java:1522)
>         at com.google.gdata.client.GoogleService.delete(GoogleService.java:
> 676)
>         .........
> ----------------------------------------------------------------------------------------------
>
> ●Pattern 4
> ------
> Source------------------------------------------------------------------------------
> String BASE_FEED_OAUTH = "http://www.google.com/calendar/feeds/";;
> String eventId = URLDecoder.decode(entry.getId().substring
> (52),"UTF-8");
>
> deleteUrl = new URL(BASE_FEED_OAUTH + eventId + "/private/full" + "?
> [email protected]");
> service.delete(deleteUrl);
>
> ------
> Error----------------------------------------------------------------------------------
> An error same as "Pattern 3"
> ----------------------------------------------------------------------------------------------
>
> ●Pattern 5
> ------
> Source------------------------------------------------------------------------------
> String BASE_FEED_OAUTH = "http://www.google.com/calendar/feeds/";;
> String eventId = URLDecoder.decode(entry.getId().substring
> (52),"UTF-8");
>
> deleteUrl = new URL(BASE_FEED_OAUTH + eventId + "/events/full" + "?
> [email protected]");
> service.delete(deleteUrl);
>
> ------
> Error----------------------------------------------------------------------------------
> An error same as "Pattern 3"
> ----------------------------------------------------------------------------------------------
>
> How do I be all right if I do it?

--

You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" 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-calendar-help-dataapi?hl=en.


Reply via email to