views:

156

answers:

1

http://forums.asp.net/t/1442084.aspx

I created an AJAX-enabled WCF service to call from a web form. the thing is that after creating it, I'm able to populate my dropdown from the items returned by the service.

but 2 hours later, I get this FireFox error message when loading the page :

 "Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element
Source File: http://localhost:50403/ThunderWeb2    /ScriptResource.axd?d=Htwz5SPOGy46DsuOfFL3pQa8Lr5_3hMVD_cps_d3FYg4iWXeG_0-3bdA95LxuQtbXGUXoHUpV1SV8q4FusAyWjJpsaLk2b6TFO_NfpB_3ro1&t=ffffffffbb99ee49
Line: 2710"

and also this :

Error: ThunderServ is not defined
Source File: http://localhost:50403/ThunderWeb2/Thunder/new_recording.aspx
Line: 105

to solve this situation, I delete the service and recreate it with the same code and then it runs fine. but after a while, (1 hour or so), the service isn't defined anymore, I get the error.

A: 

It sounds like maybe you're keeping the connection to the WCF service open for a long time.

If so, then I suggest only opening the WCF service when you need to make a method call and then closing it immediately after. In general, WCF components should be treated as stateless objects.

If you need to maintain state for a long period of time, I suggest using Durable Services which will allow your component to save its state each time you call a method on it.

Terry Donaghe