Re: [android-developers] Re: c2DM error when third-party server sends data to push

2011-01-09 Thread Nagaraj Ramarao
Hi Jose,
  No luck for me I guess.  I remove the '\n' from the Auth= value
  and followed the advice you had given but I got the following response:
Jan 9, 2011 6:18:47 PM org.apache.http.impl.client.DefaultRequestDirector
handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges:
{}

HTTP/1.1 401 Unauthorized
Content-Type: text/html; charset=UTF-8
Date: Mon, 10 Jan 2011 00:18:57 GMT
Expires: Mon, 10 Jan 2011 00:18:57 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

HTML
HEAD
TITLEUnauthorized/TITLE
/HEAD
BODY BGCOLOR=#FF TEXT=#00
H1Unauthorized/H1
H2Error 401/H2
/BODY
/HTML

Not sure how to get this thing working.

Nagaraj

On Sun, Jan 9, 2011 at 12:27 AM, Nagaraj Ramarao nraj.tes...@gmail.comwrote:

 Hi Jose,
   Happy New Year 2011!
   No I haven't got back to testing this yet.  I am busy with some other
 related issue. Hopefully I will be able to fix it soon before I can fix and
 test this issue.
   Thanks for your suggestions.  I will try them as soon as I get a chance.
 I will keep you posted.

   Regards,
   Nagaraj


 On Mon, Jan 3, 2011 at 9:44 AM, Jose Ignacio Gil Jaldo 
 naranj...@gmail.com wrote:

 Hi Nagaraj,

 I made it work... The point is: what are you sending as Auth token?
 the whole response that you got from /ClientLogin? or just the
 Auth= section? (Without the Auth=). You have to send the second
 one.

 If you're already doing it that way, try removing all \n in that
 String.

 You will also have to disable expect:continue in http requests (it's
 something that sends only the headers and if it's ok, continues
 sending the body). To do so:

HttpParams params = new BasicHttpParams();
HttpProtocolParams.setUseExpectContinue(params, false);
HttpClient httpclient = new DefaultHttpClient(params);

 That way it worked for me...

 On Jan 3, 11:25 am, Jose Ignacio Gil Jaldo naranj...@gmail.com
 wrote:
  Hi Nagaraj,
 
  could you make it work? I also tried downloading sources from google
  examples (JumpNote and Google2Chrome) and I couldn't make them work
  due to Authentication error (I think it could be related to something
  that Nasif Nooruden pointed you out about trimming the Auth string).
  However in my code, I've tried trimming the string and then I get 401
  - UnAuthorized (I suppose it is because I have wrongly changed the
  auth string).
 
  Could it be an Apache HTTP related issue?
 
  But for me the most strange thing is that I can see the header in my
  POST request and the value of Content-Length is the same as the length
  of the POST parameters (and I have no querystring parameters).
 
  On Dec 27 2010, 6:18 pm, Jose Ignacio Gil Jaldo naranj...@gmail.com
  wrote:
 
   I am having the same problem as you and I think it's not my mistake I
   have checked the tcpdump (to do it I changed from https to http to
   have plain text).
 
   POST /c2dm/send HTTP/1.1
 
   Authorization: GoogleLogin
  
 auth=SID=DQAAALw7O-9sDrg_FXztPEQ7fcfqBmPtCtIcN3gX4wTsXf7AmfQh5eetqv5jQm6FGt7QvjMJNaoZFlLNG-
   pTSPl07dQWCwM2tNSnbFCS6FO-
  
 Xe0Q0SJ6Ok4gipqqArAB2uh7mvgtHRguiWaP38IRVHcQjG4fhpo0K6LIZN0fBoE__FXl5ukqsIVc8Qo_ezXOspC_MZew76G6AvfkqwyMTM7XWzrgHDT9D9MlbgnuAWpR_XOA1KKOVO-
   eHFXp1UsCE6FM6mQ
  
 LSID=DQAAAL8AAADFjsO1Q_TnSqwZgm3HYxQsb08JcQxFwC_oucPZ3eEiqFNLhuQWJI_ZVS-
   iMuZKphHsmghU7I1sQPkFC_Iu0Jc0Fba4efoUYHcq-
   TBjLJgPQW-8aQVFMEobmMhkTJUUr0iXAibZV2Bbwd7HalGh1oZU07AtvQa7T-
  
 NMv7LUZT8rSYeSZ8kHBXKYaUHjVykVAAKmw2gS3ZDxpiklgSg8VmSyU6788JwH6lh2VpDzs1r0yoH55qOZD8gzBls64i5Lwgk
   Auth=DQAAAL8AAAD3PzwO5BSHo_TzqwD-QyTVM73-vxDAlUs8fkzbLoX5lHr6YI-
  
 D0IznRSnYoJshE9LDjtm78vcpbieT_RGBS9pnWXFier8l8uVQwITP0SLJnH2QMla4qLzylDANSqIIDdm_MY91t1wjGGivaTr5mOB_4w-0NQx_QvSQwyl--
  
 eZnEkkH-80Ul_HJYzLv6TneYGd9q1q6UUAgDszesHzBQYullYvmwY1aF2wbVCUKF4urS_ynONL55aYg01ccShzExjs
 
   Content-Type: application/x-www-form-urlencoded
 
   Content-Length: 209
 
   User-Agent: Jakarta Commons-HttpClient/3.1
 
   Host: android.apis.google.com
 
   registration_id=APA91bEhZNjB1KZRlIzolrG_oXBpn0uTxPsoX22L5Xz-
  
 i9DTK38PRNe4QgoMTG9L4mrGlx33t6k39vRewVFRF7SAMbVSj62ESJ5o1gAdfANSiC6SCdXzAfEcollapse_key=12345data.receiver=1234data.source=12345data.message=holaHTTP/
   1.0411Length Required
 
   Content-Type: text/html; charset=UTF-8
 
   Content-Length: 1363
 
   Date: Mon, 27 Dec 2010 16:30:22 GMT
 
   Server: GFE/2.0
 
   htmlhead
   meta http-equiv=content-type content=text/html;charset=utf-8
   title411Length Required/title
   style!--
   body {font-family: arial,sans-serif}
   div.nav {margin-top: 1ex}
   div.nav A {font-size: 10pt; font-family: arial,sans-serif}
   span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight:
   bold}
   div.nav A,span.big {font-size: 12pt; color: #cc}
   div.nav A {font-size: 10pt; 

Re: [android-developers] Re: c2DM error when third-party server sends data to push

2011-01-08 Thread Nagaraj Ramarao
Hi Jose,
  Happy New Year 2011!
  No I haven't got back to testing this yet.  I am busy with some other
related issue. Hopefully I will be able to fix it soon before I can fix and
test this issue.
  Thanks for your suggestions.  I will try them as soon as I get a chance. I
will keep you posted.

  Regards,
  Nagaraj

On Mon, Jan 3, 2011 at 9:44 AM, Jose Ignacio Gil Jaldo
naranj...@gmail.comwrote:

 Hi Nagaraj,

 I made it work... The point is: what are you sending as Auth token?
 the whole response that you got from /ClientLogin? or just the
 Auth= section? (Without the Auth=). You have to send the second
 one.

 If you're already doing it that way, try removing all \n in that
 String.

 You will also have to disable expect:continue in http requests (it's
 something that sends only the headers and if it's ok, continues
 sending the body). To do so:

HttpParams params = new BasicHttpParams();
HttpProtocolParams.setUseExpectContinue(params, false);
HttpClient httpclient = new DefaultHttpClient(params);

 That way it worked for me...

 On Jan 3, 11:25 am, Jose Ignacio Gil Jaldo naranj...@gmail.com
 wrote:
  Hi Nagaraj,
 
  could you make it work? I also tried downloading sources from google
  examples (JumpNote and Google2Chrome) and I couldn't make them work
  due to Authentication error (I think it could be related to something
  that Nasif Nooruden pointed you out about trimming the Auth string).
  However in my code, I've tried trimming the string and then I get 401
  - UnAuthorized (I suppose it is because I have wrongly changed the
  auth string).
 
  Could it be an Apache HTTP related issue?
 
  But for me the most strange thing is that I can see the header in my
  POST request and the value of Content-Length is the same as the length
  of the POST parameters (and I have no querystring parameters).
 
  On Dec 27 2010, 6:18 pm, Jose Ignacio Gil Jaldo naranj...@gmail.com
  wrote:
 
   I am having the same problem as you and I think it's not my mistake I
   have checked the tcpdump (to do it I changed from https to http to
   have plain text).
 
   POST /c2dm/send HTTP/1.1
 
   Authorization: GoogleLogin
  
 auth=SID=DQAAALw7O-9sDrg_FXztPEQ7fcfqBmPtCtIcN3gX4wTsXf7AmfQh5eetqv5jQm6FGt7QvjMJNaoZFlLNG-
   pTSPl07dQWCwM2tNSnbFCS6FO-
  
 Xe0Q0SJ6Ok4gipqqArAB2uh7mvgtHRguiWaP38IRVHcQjG4fhpo0K6LIZN0fBoE__FXl5ukqsIVc8Qo_ezXOspC_MZew76G6AvfkqwyMTM7XWzrgHDT9D9MlbgnuAWpR_XOA1KKOVO-
   eHFXp1UsCE6FM6mQ
  
 LSID=DQAAAL8AAADFjsO1Q_TnSqwZgm3HYxQsb08JcQxFwC_oucPZ3eEiqFNLhuQWJI_ZVS-
   iMuZKphHsmghU7I1sQPkFC_Iu0Jc0Fba4efoUYHcq-
   TBjLJgPQW-8aQVFMEobmMhkTJUUr0iXAibZV2Bbwd7HalGh1oZU07AtvQa7T-
  
 NMv7LUZT8rSYeSZ8kHBXKYaUHjVykVAAKmw2gS3ZDxpiklgSg8VmSyU6788JwH6lh2VpDzs1r0yoH55qOZD8gzBls64i5Lwgk
   Auth=DQAAAL8AAAD3PzwO5BSHo_TzqwD-QyTVM73-vxDAlUs8fkzbLoX5lHr6YI-
  
 D0IznRSnYoJshE9LDjtm78vcpbieT_RGBS9pnWXFier8l8uVQwITP0SLJnH2QMla4qLzylDANSqIIDdm_MY91t1wjGGivaTr5mOB_4w-0NQx_QvSQwyl--
  
 eZnEkkH-80Ul_HJYzLv6TneYGd9q1q6UUAgDszesHzBQYullYvmwY1aF2wbVCUKF4urS_ynONL55aYg01ccShzExjs
 
   Content-Type: application/x-www-form-urlencoded
 
   Content-Length: 209
 
   User-Agent: Jakarta Commons-HttpClient/3.1
 
   Host: android.apis.google.com
 
   registration_id=APA91bEhZNjB1KZRlIzolrG_oXBpn0uTxPsoX22L5Xz-
  
 i9DTK38PRNe4QgoMTG9L4mrGlx33t6k39vRewVFRF7SAMbVSj62ESJ5o1gAdfANSiC6SCdXzAfEcollapse_key=12345data.receiver=1234data.source=12345data.message=holaHTTP/
   1.0411Length Required
 
   Content-Type: text/html; charset=UTF-8
 
   Content-Length: 1363
 
   Date: Mon, 27 Dec 2010 16:30:22 GMT
 
   Server: GFE/2.0
 
   htmlhead
   meta http-equiv=content-type content=text/html;charset=utf-8
   title411Length Required/title
   style!--
   body {font-family: arial,sans-serif}
   div.nav {margin-top: 1ex}
   div.nav A {font-size: 10pt; font-family: arial,sans-serif}
   span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight:
   bold}
   div.nav A,span.big {font-size: 12pt; color: #cc}
   div.nav A {font-size: 10pt; color: black}
   A.l:link {color: #6f6f6f}
   A.u:link {color: green}
   //--/style
   script!--
   var rc=411;
   //--
   /script
   /head
   body text=#00 bgcolor=#ff
   table border=0 cellpadding=2 cellspacing=0 width=100%trtd
   rowspan=3 width=1% nowrap
   bfont face=times color=#0039b6 size=10G/fontfont face=times
   color=#c41200 size=10o/fontfont face=times color=#f3c518
   size=10o/fontfont face=times color=#0039b6 size=10g/fontfont
   face=times color=#30a72f size=10l/fontfont face=times
   color=#c41200 size=10e/fontnbsp;nbsp;/b
   tdnbsp;/td/tr
   trtd bgcolor=#3366ccfont face=arial,sans-serif
   color=#ffbError/b/td/tr
   trtdnbsp;/td/tr/table
   blockquote
   H1Length Required/H1
   POST requests require a codeContent-length/code header.
 
   p
   /blockquote
   table width=100% cellpadding=0 cellspacing=0trtd
   bgcolor=#3366ccimg alt= width=1 height=4/td/tr/table
   /body/html
 
   This is my code:
   Protocol myhttps =