Search This Site

Custom Search

Sunday, January 16, 2011

Re: [bloggerDev] Operation TimeOut on Test Server not on LocalHost

Heya Laki,

Before I dive into trying to understand what is broken in your code, can you please confirm that the following example code works in your environment?


That way I can confirm your libraries are installed correctly, and you are authenticating sanely et al.

brett

On Mon, Jan 17, 2011 at 2:49 PM, Laki <apolitis@stetson.edu> wrote:
Hi. I'm using ASP.NET and the Google Client to access a blog on a
website I'm developing. I can access the feed for the blog online
without any issues: http://flomotionblog.blogspot.com/feeds/posts/default
. Whenever I try to call it through our web server test.theflomo.com,
I get nothing but a session time out.

Here's the error I'm getting:
--------------------------------------------------------------------------------------------------------------------------------------------------
[WebException: The operation has timed out]
  System.Net.HttpWebRequest.GetRequestStream(TransportContext&
context) +1876129
  System.Net.HttpWebRequest.GetRequestStream() +13

Google.GData.Client.Utilities.QueryClientLoginToken(GDataCredentials
gc, String serviceName, String applicationName, Boolean fUseKeepAlive,
Uri clientLoginHandler) +564

Google.GData.Client.GDataGAuthRequest.QueryAuthToken(GDataCredentials
gc) +248
  Google.GData.Client.GDataGAuthRequest.EnsureCredentials() +41
  Google.GData.Client.GDataRequest.EnsureWebRequest() +1101
  Google.GData.Client.GDataGAuthRequest.EnsureWebRequest() +26
  Google.GData.Client.GDataRequest.Execute() +42

[GDataRequestException: Execution of request failed:
http://flomotionblog.blogspot.com/feeds/posts/default]
  Google.GData.Client.GDataRequest.Execute() +162
  Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
+402
  Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
+423
  Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
+423
  Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
+423
  Google.GData.Client.GDataGAuthRequest.Execute() +10
  Google.GData.Client.Service.Query(Uri queryUri, DateTime
ifModifiedSince, String etag, Int64& contentLength) +193
  Google.GData.Client.Service.Query(FeedQuery feedQuery) +202
  FloMoTest.blog.loadBlog() in blog.aspx.cs:52
  FloMoTest.blog.Page_Load(Object sender, EventArgs e) in
blog.aspx.cs:36
  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e) +14
  System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e) +35
  System.Web.UI.Control.OnLoad(EventArgs e) +99
  System.Web.UI.Control.LoadRecursive() +50
  System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+627
--------------------------------------------------------------------------------------------------------------------------------------------------

Here's my code behind:
--------------------------------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Google.GData.Blogger;
using Google.GData.Client;
using Google.GData.Extensions;

namespace FloMoTest
{
       public partial class blog : System.Web.UI.Page
       {
               private struct BlogItem
               {
                       public string title { get; set; }
                       public string authors { get; set; }
                       public string dates { get; set; }
                       public string links { get; set; }
                       public string summary { get; set; }
                       public string fullText { get; set; }
                       public string reqURI { get; set; }
               }

               protected void Page_Load(object sender, EventArgs e)
               {

                       loadBlog();
               }
               protected void loadBlog()
               {

                       string userName = "XXXXXXXXXX";
                       string passWord = "XXXXXXXXXX";

                       FeedQuery feedQuery = new FeedQuery();
                       feedQuery.Uri = new Uri("http://flomotionblog.blogspot.com/feeds/
posts/default
");

                       Service googleService = new Service("blogger", "theFloMo.com");
                       googleService.Credentials = new GDataCredentials(userName,
passWord);

                       AtomFeed atomFeed = null;

                       atomFeed = googleService.Query(feedQuery);

                       AtomLink atomLink = new AtomLink();

                       List<BlogItem> BlogItems = new List<BlogItem>();

                       foreach (AtomEntry entry in atomFeed.Entries)
                       {
                               string itemSummary = "";
                               string itemTitle = entry.Title.Text;
                               string itemAuthors = entry.Authors[0].Name.ToString();
                               string itemDates =
entry.Published.ToLongDateString().Remove((entry.Published.ToLongDateString().Length
- 6), (6));
                               string itemLinks = entry.Links[1].HRef.ToString();
                               string itemReqURI = entry.Id.AbsoluteUri.Remove(0, 51);

                               if (entry.Content.Content.Length <= 550)
                               {
                                       itemSummary = entry.Content.Content;
                               }
                               else
                               {
                                       itemSummary = (entry.Content.Content.Remove(550) + " ...");
                               }
                               string itemFullText = entry.Content.Content;

                               BlogItems.Add(new BlogItem()
                               {
                                       title = itemTitle,
                                       authors = itemAuthors,
                                       dates = itemDates,
                                       links = itemLinks,
                                       summary = itemSummary,
                                       fullText = itemFullText,
                                       reqURI = itemReqURI,
                               });
                       }
                       if (BlogItems.Count >= 5)
                       {
                               blogRPT.DataSource = BlogItems.Take(5);
                       }
                       else
                       {
                               blogRPT.DataSource = BlogItems;
                       }
                       blogRPT.DataBind();

               }
       }
}

--------------------------------------------------------------------------------------------------------------------------------------------------

Any help would be appreciated.

Thank you,

Laki Politis.

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.




--

Brett Morgan

Developer Programs Engineer, Blogger

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment