Monday, 15 March 2010

c# - Silverlight 3 WCF Service `CommunicationException` Server returned error: NotFound -


I have a Silverlight 3 application, which has been successfully requested data from 95% of the WCF service (same Vebpad ) And display it in

It sometimes happens, usually if I bunch the service repeatedly, but sometimes it happens on a single request.

Every once in a while, if I request multiple transactions in a short time, I get one of the two exceptions, they both have both the reference.cs file In EndMyMethod (System.IAsyncResult results) come in.

There are a few ways, and there are exceptions to any of them. First, a Taimautaksepshn () that I think it makes sense, the second, which do not get me completely is " CommunicationException () was unchecked user By Code: Remote server returned an error: NotFound. "

I blocked try..catch , press both . There is no use in handler for MyMethodAsync () and MyMethodCompleted , as the exception is generated in the Reference.cs file.

Any help is greatly appreciated.

Update

context.cs - "Add Service" the reference "

  public system. Aisaiansiar results start toggle Krenggl (string id, string system. Async callback callback object asyncState) {object [] _args = new object [2 ]; _args [0] = id; _args [1] = toggle; System.IAsyncResult _result = base.BeginInvoke ( "TogglePicked", _args, callback, AsyncState),; Return _result;} public void EndTogglePicked (System.IAsyncResult result) { Object [] _args = new object [0]; // This is the line where the exception has been dropped. EndInvoke ("TogglePicked", _args, Results);}  

Calling Code - selected ID is a list of strings, and to define a string event on top of the process handler select User ID mdc_TogglePIckedCompleted is empty at the moment.

  MapData Client MDC = New MyDataClient (); Mdc.TogglePickedCompleted + = New Event Handler & lt; System.ComponentModel.AsyncCompletedEventArgs & gt; (Mdc_TogglePickedCompleted); Foreign currency (string ID in chosen ID) {mdc.TogglePasyAsync (id, userIDSelecting, mdc); }  

Update 2

This "Inraksashn" communication Ikspasn: System.Net.WebException: Remote server error Return: NotFound.

Not sure if this is more helpful because it is not giving any additional details. As I said, every time I call the service system, it is embedded. I would also like to say that only one call will work and not others, I am thinking that this issue is because IIS has failed to answer my call, answer the ideas?

Update 3

When I mean interim, I mean the triple intimate. It can only happen at the user's session at the same time, and it can only be on one of the fifty sessions, it is not an all-in-one thing. The calling application is hosted as WCF service in the same "website", so I do not think there is a clientexololicy.mmm problem, but I could be wrong.

The message you are receiving is probably a red herring: - (

< P> When an internal WCF service exception is thrown, it will always appear as an exception in the Silverlight UI not found server , because the HTTP response type is 500. David Boyz - (It was written for SL2, but the concepts are still for SL3. For example, "never", using the service reference features from VS - you do not have to follow all of them ;-))

However, back to your question, you Need to change the response type to 200 and purse the exception in the message. This can be done using an inspector (in service and in the SL app).

  • There are quite a few articles on how to do this on the net. An example of a work can be downloaded from CodePlex: (page "Message Inspector" below the download link)

Some of these approaches may seem quite challenging. Let's take some time to understand it - the concept is important for WCF & lt; -> SL application, and it is understood after receiving it: -)

We have used it with a lot of success since the beginning of this year, so if you Need help with this now and help me tell me


No comments:

Post a Comment