I am developing Application for Windows Phone using .Net Compact Framework 3.5
I am trying to connect Web Services from this application.
It is not connecting it in First Attempt, but it is connecting successfully in second and further attempts.
In First Attempt, It is giving "Web Exception" Error.
I am using following code for connecting:
SalesService.SalesService obj = new SalesService.SalesService();
string s = obj.CheckForValidService();
It is giving error in CheckForValidService method from Reference.cs file.
Ah, the old Expect-100 header issue. You will need to surpress the use of that header.
System.Net.ServicePointManager.Expect100Continue = false;
MSDN details:
Stackoverflow details:
The request failed with HTTP status 417: Expectation Failed - Using Web Services