https://pubsubhubbub.appspot.com/subscribe null response

I have a subscriber client that connects to https://pubsubhubbub.appspot.com/subscribe I put parameter below

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

but I got null response I can't understand what is the problem thank you for your help

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();

thank you

Upvotes: 0

Views: 438

Answers (1)

Julien Genestoux
Julien Genestoux

Reputation: 33052

The first thing you should check is the HTTP status of the response, and then, check the body itself, as may include what you're doing wrong.

Also, based on your example, I am almost certain the issue is with your callback url. When you send a subscription request to the hub, the hub needs to check back with you that you want this subscription. It then sends a request to your callback url (check the verification of intent section in the spec). Since your callback is indeed behind the firewall, the hub will never be able to reach it.

Upvotes: 1

Related Questions