Hi,
Though you concat your spreadsheet credentials key against the feed request 
url, it seems to be wrong. The key should be set into authorization header. 

-- 
Hitoshi Uchida

On 2011/03/03, at 14:43, Sarath K S <[email protected]> wrote:

> Thanks All,
> 
> It was my mistake. I was trying to login with my domain password
> rather than Google Apps password. Today only I found out the issue.
> Thanks a lot for the help.
> 
> Now I am facing a different problem. I am getting
> "com.google.gdata.util.ParseException: The AElfred parser is a SAX2
> XMLReader"
> 
> This is my code.
> 
> 
> import java.net.URL;
> 
> import com.google.gdata.client.spreadsheet.SpreadsheetService;
> import com.google.gdata.data.spreadsheet.SpreadsheetEntry;
> 
> public class Test {
>    public static void main(String[] args) {
>        try {
>            SpreadsheetService service = new
> SpreadsheetService("MySpreadsheetService");
>            service.setUserCredentials("$username", "$password");
> 
>            String SPREADSHEET_FEED_URL_PATH = 
> "https://spreadsheets.google.com/
> feeds/spreadsheets/private/full/";
>            URL feedUrl = new URL( SPREADSHEET_FEED_URL_PATH +
> "Spreadsheetkey");
> 
>            SpreadsheetEntry sourceEntry = service.getEntry( feedUrl,
> SpreadsheetEntry.class );
>        } catch (Exception e) {
>            e.printStackTrace();
>        }
>    }
> }
> 
> 
> Can you please help me? This piece of code was working earlier but now
> I am getting "The AElfred parser is a SAX2 XMLReader" exception.
> 
> Thanks & Regards,
> Sarath
> 
> On Mar 3, 1:27 am, Vic Fryzel <[email protected]> wrote:
>> Hmm.  The default for setUserCredentials(username, password) is
>> HOSTED_OR_GOOGLE, which should be fine.
>> 
>> Can you email me privately the value you're using for username?  I'm unaware
>> of a way to reproduce what you've described without either a) not providing
>> a valid email address as username, or b) not providing a valid password.
>> 
>> -Vic
>> 
>> On Wed, Mar 2, 2011 at 9:36 AM, Sarath K S <[email protected]> wrote:
>> 
>>> Hi,
>> 
>>> I tried that too, but the same exception.
>> 
>>> com.google.gdata.client.GoogleService$InvalidCredentialsException:
>>> Invalid credentials
>>>        at
>> 
>>> com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:
>>> 586)
>>>        at
>> 
>>> com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:
>>> 490)
>>>        at
>> 
>>> com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:
>>> 336)
>>>        at
>> 
>>> com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:
>>> 362)
>>>        at
>> 
>>> com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:
>>> 317)
>>>        at com.cordys.uc.webapps.uimodeler.mtor.Test.main(Test.java:18)
>> 
>>> Thanks & Regards,
>>> Sarath
>> 
>>> On Mar 2, 7:07 pm, hitoshi uchida <[email protected]> wrote:
>>>> Hi,
>>>> Could you retry with setUserCredentials(String username, String
>>>> password, ClientLoginAccountType accountType) ? The accountType is
>>>> ClientLoginAccountType.HOSTED.
>> 
>>>> On 3月1ζ—₯, 午後8:21, Sarath K S <[email protected]> wrote:
>> 
>>>>> import com.google.gdata.client.spreadsheet.SpreadsheetService;
>> 
>>>>> public class Test {
>>>>>         public static void main(String[] args) {
>>>>>                 try {
>>>>>                         SpreadsheetService service = new
>>>>> SpreadsheetService("MySpreadsheetService");
>>>>>                         service.setUserCredentials("username@mydomain",
>>> "password");
>>>>>                 } catch (Exception e) {
>>>>>                         e.printStackTrace();
>>>>>                 }
>>>>>         }
>> 
>>>>> }
>> 
>>>>> This code is throwing me invalid credentials exceptions, but the
>>>>> credentials I have used are valid.
>> 
>>>>> Can you please help me identify whats the issue?
>> 
>>>>> Thanks & Regards,
>>>>> Sarath

Reply via email to