So you're getting connected and you're getting a response. And the response is, there was an error on server B. The thing to do now is to go over to server B and look in its logs to find out what that error was.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com