2011-12-20 9 views
0

私はhttps://pubsubhubbub.appspot.com/subscribeヌル応答

https://pubsubhubbub.appspot.com/subscribe 
hub.topic http://...../lastupby 
hub.callback http://localhost:8080/Subscription/subscription/subscribe 
hub.mode subscribe 

の下にパラメータを置くが、私は、私は問題が何であるかを理解することはできませんヌル応答を得たhttps://pubsubhubbub.appspot.com/subscribeに接続する加入者のクライアントを持っていますあなたの助けをありがとう

HttpPost httppost = new HttpPost(hub); 
       List<NameValuePair> nvps = new ArrayList<NameValuePair>(); 
       nvps.add(new BasicNameValuePair("hub.callback", callbackUrl)); 
       nvps.add(new BasicNameValuePair("hub.mode", "subscribe")); 
       nvps.add(new BasicNameValuePair("hub.topic", topic_url)); 
       nvps.add(new BasicNameValuePair("hub.verify", "sync")); 
       if (lease_seconds != null) 
        nvps.add(new BasicNameValuePair("hub.lease_seconds", lease_seconds)); 
       //For future https implementation 
       //if ((secret !=null) && (secret.getBytes("utf8").length < 200)) 
       // nvps.add(new BasicNameValuePair("hub.hub.secret", secret)); 
       if (verifytoken !=null) 
        nvps.add(new BasicNameValuePair("hub.verify_token", verifytoken)); 

       webserver.addAction("subscribe",topic_url, verifytoken); 

       httppost.setEntity(new UrlEncodedFormEntity(nvps)); 
       httppost.setHeader("Content-type", "application/x-www-form-urlencoded"); 
       httppost.setHeader("User-agent", "RSS pubsubhubbub 0.3"); 

       //create the thread and start it running 
       GetThread thread = new GetThread(httpClient, httppost); 
       thread.start(); 
       thread.join(); 

は、あなたがしているものを含むことができて、あなたがチェックすべき最初の事は、応答のHTTPステータスで、その後、体自体をチェックします

+1

どのようなエラー/例外が表示されますか? –

+0

私はSystem.out.println( "thread.httpresponse" + thread.httpresponse.getStatusLine()。getReasonPhrase())のようなレスポンスコードを取得しようとするとエラーが表示されません。それはnullを返します///私たちはプロキシの背後で動作します、それはこの状況に引き起こされますか?私は確信していません –

答えて

1

に感謝します間違っている。

また、あなたの例に基づいて、私はあなたのコールバックURLに問題があることはほとんど確信しています。ハブにサブスクリプションリクエストを送信すると、ハブはこのサブスクリプションを確認する必要があるかどうかを確認する必要があります。その後、コールバックURLに要求を送信します(仕様のインテントセクションの確認を確認してください)。あなたのコールバックは実際にファイアウォールの背後にあるので、ハブは決してそれに到達することができません。

+0

私はチェックしますが、私はサブスクリプションのリクエストは、コールバックとサブスクリプションのトピックをピングするGoogleハブですか?おそらくサブスクリプションのURLが間違っている可能性があります –