So work on my Pocket Post has been slowly progressing, right now I am just hunting down annoying bugs. Most of them I didn’t created, and I am stuck Googling for them. To help others out, I thought I would describe the problem and give the solution.
- Problem: I keep getting the error: “Could not establish trust relationship with remote server” when trying to connect to a server using SSL. The server in question was the Blogger server.Solution: I tried just typing in the address “https://www.blogger.com/atom” into the browser and it turns out that blogger’s certificate is bad. Since you are accessing blogger programatically, the warning never pops up and instead the request fails. The workaround is to add your own certificate processing routine that will accept any certificate, even if it is not valid. I found a great bit of code here that does just that: CODE. Problem solved!
- Problem: After adding this code, I kept getting a weird build error from Visual Studio saying it was having trouble finding a resource: “The “GenerateResource” task failed unexpectedly. System.Runtime.InteropServices.COMException (0×8000000A): The data necessary to complete this operation is not yet available.” Solution: Turns out I wasn’t the only one having this problem. Unfortunately no one, not even Microsoft had an idea of what exactly was causing it, luckily they had a solution that involves changing the Project file. Unfortunately there solution has a small bug, it should be:
true They are missing a “/”. Anyhow this seemed it fix it for me. - Problem: The Atom API for blogger seems to be giving errors for some posts and not other.
Solution: Turns out the problem was that I was sending non-escaped charecters: !, &, <, > without properly packaging them. To fix this I placed the Title string and the Post Content string in CDATA tags. Now it looks like this:""and things work much better!