Function evaluation timed out - wcf

I am using linq to sql in a Silverlight application and I keep getting this debug error..
http://www.freeimagehosting.net/uploads/bf4055b4ee.jpg
This code runs when the application is started up without problems. When I call it the second time, I only get a few of the results. When I add a breakpoint to the WCF service I get the following error...
Could someone please tell me whats going on here so i can make some changes?
TIA
ps. Might not be the most efficient coding but I will sort all that out later :P

If you add a breakpoint to the service code the caller will throw a Timeout Exception after the timeout time has passed. Raise the timeout of your service (on the server and client side), this will allow you to debug your service code without getting exceptions.

Related

WCF - Return and continue processing

I have a WCF method.
I would like to return to user a result and continue processing in the server side (via .net Task).
The problem is that I have the "Cannot access a disposed object." error message when I continue processing in the server side.
can anyone help ? how can I implement that. Return a result to user but continue working in the server side.
thanks
Hagai
explore callback contract option for your scenario - http://www.dotnetcurry.com/ShowArticle.aspx?ID=721

How to log error 500 in wcf applications

We all are know some time we will get 500 error while trying to hit wcf url. for example if pass string value to integer parameter it will throw 500 error as request error. my question is how to log, this kind error in some file? because this will not reach our actual end point class coding right? so how to log this error in some file?
Any Help?
Assuming you want to log these on the server size, you should configure WCF tracing and use SvcTraceViewer to analyze the logs. More details on MSDN: http://msdn.microsoft.com/en-us/library/ms732023.aspx.
I may very well be wrong here - but if the client is supplying the wrong parameters to a web method, that would be a 404 as no method matches the incoming request?
I would say it's the clients job to send the right data to the right function, and to handle failures appropriately (an EndPointNotFoundException perhaps)

Function evaluation timed out

I have WCF service.. couple times it was working ok.. but after certain point in time the function returns "Function evaluation timedout".. what the heck is this? also, when I checked the state of the proxy it was opened.. can anyone please help?
thanks
I would guess it is one of two things. Either it is a custom error in your application or it is stuck on a debug point. Refer: http://social.msdn.microsoft.com/forums/en-US/vsdebug/thread/728b9404-60b1-4951-99f8-70a5f75cba61/
Please supply more information about what the service is doing.

WCF Catastrophic Failure

I've got a real lemon on my hands. I hope someone who has the same problem or know how to fix it could point me in the right direction.
The Setup
I'm trying to create a WCF data service that uses an ADO Entity Framework model to retrieve data from the DB. I've added the WCF service reference and all seems fine. I have two sets of data service calls. The first one retrieves a list of all "users" and returns (this list does not include any dependent data (eg. address, contact, etc.). The second call is when a "user" is selected, the application request to include a few more dependent information such as address, contact details, messages, etc. given a user id. This also seems to work fine.
The Lemon
After some user selection change, ie. calling for more dependent data from the data service, the application stops to respond.
Crash error:
The request channel timed out while waiting for a reply after 00:00:59.9989999. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
I restart the debugging process but the application will not make any data service calls until after about a minute or so, VS 08 displays a message box with error:
Unable to process request from service. 'http://localhost:61768/ConsoleService.svc'. Catastrophic failure.
I've Googled the hell out of this error and related issues but found nothing of use.
Possible Solutions
I've found some leads as to the source of the problem. In the client's app.config:
maxReceivedMessageSize > Set to a higher value, eg. 5242880.
receiveTimeout > Set to a higher value, eg. 00:30:00
I've tried these but all in vain. I suspect there is an underlying problem that cannot be fixed by simply changing some numbers. Any leads would be much appreciated.
I've solved it =P.
Cause
The WCF service works fine. It was the data service calls that was the culprit. Every time I made the call, I instantiated a new reference to the data service, but never closed/disposed the service reference. So after a couple of calls, the data service reaches its maximum connection and halts.
Solution
Make sure to close/dispose of any data service reference properly. Best practice would be to enclose in a using statement.
using(var dataService = new ServiceNS.ServiceClient() )
{
// Use service here
}
// The service will be disposed and connection freed.
Glad to see you fixed your problem.
However, you need to be carefull about using the using statement. Have a look at this article:
http://msdn.microsoft.com/en-us/library/aa355056.aspx

Data not coming through from RIA Services in Silverlight

I had a connection working but something changed and now the data isn't showing up. It is a simple query that worked before that just returns all entities. I put in break points on the LoadOperation call and it fires and gets 0 entities. I also put a break point on the service itself, and it does not break before the LoadOperation evaluates. After the LoadOperation completes, then the service query is called... well after we needed the data. The only thing that I can think of that could be a problem is that I added 2 WCF services to the solution. Would WCF services stop the RIA from working? Any ideas on what else could cause the problem?
Client:
LoadOperation<Project> loadOp =
this._projectContext.Load(this._projectContext.GetProjectsQuery());
Service:
public IQueryable<Project> GetProjects()
{
return this.Context.Projects;
}
See, real basic, but not working.
You need to put a callback method on your Load operation and then check the results of the LoadOperation.Error when it comes back. In that error you will find the exception which will let you know what the problem is (you will probably have to check the inner exception to get the full details).