none
Execution of authentication request returned unexpected result: 404. RRS feed

  • Question

  •   public void LoginToBlog1()
        {
            Service service = new Service("blogger", "blogger-example");
            SqlConnection con = new SqlConnection(connection);
            SqlCommand cmd = new SqlCommand();
            string blogname = string.Empty;
            cmd.CommandText = "select UserName,Password,BlogName from ApplicationBlogs where ApplicationId=" + appid1 + " and BlogType='" + DownloadType + "' and Category='" + category1 + "' and BlogUrl is null";
            cmd.Connection = con;
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                string username = dr["UserName"].ToString();
                string password = dr["Password"].ToString();
                service.Credentials = new GDataCredentials(username, password);
                blogname = dr["BlogName"].ToString();
            }
            con.Close();
    
            Uri blogPostUri = SelectUserBlog(service, blogname);
            ListBlogEntries(service, blogPostUri);
    
    
        }
    
    
     static Uri SelectUserBlog(Service service, string title)
        {
            FeedQuery query = new FeedQuery();
            query.Uri = new Uri("https://www.blogger.com/feeds/default/blogs");
            AtomFeed feed = service.Query(query);
            Uri blogPostUri = null;
            if (feed != null)
            {
                foreach (AtomEntry entry in feed.Entries)
                {
                    if (title.Equals(entry.Title.Text))
                    {
                        for (int i = 0; i < entry.Links.Count; i++)
                        {
                            if (entry.Links[i].Rel.Equals("https://schemas.google.com/g/2005#post"))
                            {
                                blogPostUri = new Uri(entry.Links[i].HRef.ToString());
                            }
                        }
                        return blogPostUri;
                    }
                }
            }
            return blogPostUri;
        }

    Monday, July 6, 2015 8:28 AM

Answers

  • hi Ramanil,
       As per my research for this case, this issue might be related to Third party (GDataCredential).
    Its beyond the scope of this forum.
    So I suggest you to post this thread to here which may provide you the better solution.
    Thursday, July 9, 2015 7:22 AM

All replies

  • 404 means file not found, which usually means the URI is wrong. You can use Fiddler to find out what is not found.
    Monday, July 6, 2015 10:58 AM
  • hi Ramanil,
      According to the 404 Error, you need to make sure that the given web address "https://schemas.google.com/g/2005#post" is correct or not.
    Tuesday, July 7, 2015 5:47 AM
  • my exception is at:
    AtomFeed feed = service.Query(query);
    how can i solve this.please explain clearly
    Tuesday, July 7, 2015 9:31 AM
  • hi Ramanil,
       As per this case, you can try like below :

    public void LoginToBlog1() { Service service = new Service("blogger", "blogger-example"); SqlConnection con = new SqlConnection(connection); SqlCommand cmd = new SqlCommand(); string blogname = string.Empty; cmd.CommandText = "select UserName,Password,BlogName from ApplicationBlogs where ApplicationId=" + appid1 + " and BlogType='" + DownloadType + "' and Category='" + category1 + "' and BlogUrl is null;"; cmd.Connection = con; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { string username = dr["UserName"].ToString(); string password = dr["Password"].ToString(); service.setUserCredentials(username, password); blogname = dr["BlogName"].ToString(); } con.Close();

    Uri blogPostUri = SelectUserBlog(service, blogname); ListBlogEntries(service, blogPostUri); } static Uri SelectUserBlog(Service service1, string title) { FeedQuery query = new FeedQuery();
    Service service =service1; query.Uri = new Uri("https://www.blogger.com/feeds/default/blogs"); AtomFeed feed = service.Query(query); Uri blogPostUri = null; if (feed != null) { foreach (AtomEntry entry in feed.Entries) { if (title.Equals(entry.Title.Text)) { for (int i = 0; i < entry.Links.Count; i++) { if (entry.Links[i].Rel.Equals("https://schemas.google.com/g/2005#post")) { blogPostUri = new Uri(entry.Links[i].HRef.ToString()); } } //return blogPostUri; } } } return blogPostUri; }

    Wednesday, July 8, 2015 8:01 AM
  • but it throws same exception ###Edwin Guru Singh
    Wednesday, July 8, 2015 9:52 AM
  • hi Ramanil,
       you can try like below :

    public void LoginToBlog1() {   Uri blogPostUri;   
    string username,password;
    Service service = new Service("blogger", "blogger-example"); SqlConnection con = new SqlConnection(connection); SqlCommand cmd = new SqlCommand(); string blogname = string.Empty; cmd.CommandText = "select UserName,Password,BlogName from ApplicationBlogs where ApplicationId=" + appid1 + " and BlogType='" + DownloadType + "' and Category='" + category1 + "' and BlogUrl is null;"; cmd.Connection = con; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { username = dr["UserName"].ToString(); password = dr["Password"].ToString(); blogname = dr["BlogName"].ToString();

      blogPostUri = SelectUserBlog(service, blogname,username,password);
      ListBlogEntries(service, blogPostUri); } con.Close(); } static Uri SelectUserBlog(Service service1, string title,string username,string password) { FeedQuery query = new FeedQuery(); Service service =service1;
    service.setUserCredentials(username, password); query.Uri = new Uri("https://www.blogger.com/feeds/default/blogs"); AtomFeed feed = service.Query(query); Uri blogPostUri = null; if (feed != null) { foreach (AtomEntry entry in feed.Entries) { if (title.Equals(entry.Title.Text)) { for (int i = 0; i < entry.Links.Count; i++) { if (entry.Links[i].Rel.Equals("https://schemas.google.com/g/2005#post")) { blogPostUri = new Uri(entry.Links[i].HRef.ToString()); } } //return blogPostUri; } } } return blogPostUri; }

    Thursday, July 9, 2015 2:12 AM
  • It's also not working Same exception occuring ####Edwin Guru Singh
    Thursday, July 9, 2015 4:22 AM
  • thank you for your answers...plz try to give another solution for this...
    Thursday, July 9, 2015 4:26 AM
  • hi Ramanil,
       As per my research for this case, this issue might be related to Third party (GDataCredential).
    Its beyond the scope of this forum.
    So I suggest you to post this thread to here which may provide you the better solution.
    Thursday, July 9, 2015 7:22 AM