Web Services Not Associated with First Attempt

I am developing a Windows Phone application using .Net Compact Framework 3.5

I am trying to connect web services from this application.

He does not connect it in First Attempt, but successfully connects in the second and subsequent attempts.

In the first attempt, the error "Web Exception" appears. enter image description here

I use the following code to connect:

SalesService.SalesService obj = new SalesService.SalesService(); 
 string s = obj.CheckForValidService(); 

It gives an error in the CheckForValidService method from the Reference.cs file.

Error Details

+3
source share
1 answer

Ah, the old Expect-100 header problem. You will need to disable the use of this header.

System.Net.ServicePointManager.Expect100Continue = false;

MSDN Details:

http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.expect100continue(v=vs.90).aspx

Stackoverflow:

HTTP- 417: - -

+2

All Articles