Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
var request = (HttpWebRequest)WebRequest.Create(Uri);
                request.Method = "POST";
                request.Timeout = 50*1000;
    
                StreamWriter sw = new StreamWriter(request.GetRequestStream());
step 1      sw.Write(SoapMessage);
            sw.Flush();
            sw.Close();
                
step 2      response = (HttpWebResponse)request.GetResponse();


we are getting response but
between step 1 and step 2 it is taking nearly 2 min
the 3rd party server is with in the LAN

also i have done ping test with in milli seconds we can able to ping to the server

why..?
Posted
Updated 1-Jan-15 22:18pm
v2
Comments
[no name] 2-Jan-15 4:22am    
It might be the case that your internet is slow and the server to which you are sending a request is having some network related issues. Once restart the server to which you are sending the request and it will work fine.
sagar.panuganti 2-Jan-15 4:28am    
Thanks for your quick response . there is no chance of internet slow because both are in same LAN. Is there any other reasons for this issue... Because 3rd party server are not in our control
[no name] 2-Jan-15 4:34am    
If you are using the 3rd party service then check the sendtimeout and receivetimeout in the config file. Try to change the timeout value to a bit more and check whether it is working or not. If increasing the timeout value in config works then you can ask the 3rd party to restart the IIS and it will work.
sagar.panuganti 2-Jan-15 6:04am    
I have used a firefox rest client i got the response with in seconds.
Arjsrya 2-Jan-15 4:31am    
Did you check the service using any rest client?What is the response time?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900