Web page Vs web service communication
I have a asp.net application connecting to a .net web service, whenever i login & reach the main page, web services returns me back the data.
But if i login for may be more than 1 or 2hrs, when i click any of the links i get:
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I don't use sessions & don't wish here to use, all i need to web page & web services should be communicated all the time.
W开发者_C百科hat is the fix for this? Thanks.
update from op comments to an answer:
bool IsActive=WS.IsActive(ID);
IsActive is a web method:
[SessionExtension]
[DeveloperToken]
[SoapHeader("Session")]
[SoapHeader("developerToken")]
[WebMethod]
public bool IsActive(int ID) {
....code....
}
There is no where in the web service code that after some 1 or 2 hrs timing out of the result
I guess you are trying to serve the service methods on localhost and get the data and you do that correctly. If you close your localhost connection in that 1 hour, you cannot reach the data. You can deploy the service on a server then to make it full time work.
If the asmx is already on the server side, you can try to debug the code maybe, with a breakpoint on the code, running it and sending request to your localhost URL using SOAP UI.
精彩评论