This could be one of the issue you might face while using service call or HTTP Post to server. Though this issue rarely happens but in case you encounter such error in your production, possibility is your client application is facing issue connecting to the server due to proxy server.
If you come across such issue, this quick blog post will help you to resolve it. You don’t need to do much, but just a configuration settings will help you.
You might face this issue when a client is running through a HTTP 1.0 proxy server. The client (the .asmx or WCF service proxy without any configuration) is sending a HTTP 1.1 request and the proxy rejects it before any server could ever get involved. Some server sends the 417 error as part of the header in response.
In .NET, the System.Net.HttpWebRequest adds the header 'HTTP header "Expect: 100-Continue"' to every request unless you explicitly ask it not to by setting this static property “System.Net.ServicePointManager.Expect100Continue” to false.
If you encounter the error “The remote server returned an error: (417) Expectation Failed”, add the following code in you application before the call:
System.Net.ServicePointManager.Expect100Continue = false;
You can also specify that property in your app.config:
<servicePointManager expect100Continue="false" />
You can learn more about this settings/properties in MSDN: ServicePointManager.Expect100Continue
Hope that the post was useful and helped you to resolve your issue connecting to service. Don’t just stop here. Check out my other blog posts, articles and tips. I am available on Twitter, Facebook and Google+. Do connect with me there to get the latest technical updates that I share. Also, subscribe to my blog’s RSS feed and email newsletter. Happy coding.