Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
I am using follwoign code to submit site map to webmaster tools


Google.GData.WebmasterTools.WebmasterToolsService service = new Google.GData.WebmasterTools.WebmasterToolsService("www.test1.com");
service.setUserCredentials("email", "password");
String lWebsite = "http%3A%2F%2Fwww%2Etest1%2Ecom%2F";
query.Uri = new Uri("https://www.google.com/webmasters/tools/feeds/sites/");

Google.GData.WebmasterTools.SitemapsEntry se = new Google.GData.WebmasterTools.SitemapsEntry();
se.Content.Src = "http://www.test1.com/Sitemap.xml";
se.Content.Type = "text/xml";
Google.GData.WebmasterTools.SitemapsEntry ret = service.Insert(new Uri("https://www.google.com/webmasters/tools/feeds/sites/" + lWebsite + "/sitemaps/"), se);

But no luck with this code. can any one provide me some sample code to submit site map?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900