开发者

RIA domainservice/context call fails from Silverlight sometimes

I have a very strange problem: I'm developing a Silverlight business application with RIA services.

I have some DomainServices on the server-side, and with one of them I'm having the problem, that sometimes calling one of the methods fails (on the SL client, I get "NotFound" exception, and the request doesn't event arrive to the server (I put a breakpoint into the constructor of the domainservice)!

What makes things strange even more:

  • If the call fails from the SL client, then I start Fiddler2, then the second (or any consecutive) call is working properly! If I close fiddler, it becomes unstable again.
  • If I rename the method which I would like to call (via refactor), call renamed method on the context at SL client side too, then everytime I make the call it is successful!

Here is my suspicios method:

[Invoke]
public void RegisterTrainingProgramCompletion(bool isCompleted, int result, string sportsManNote)
{
 //...
}

If I rename this method to "RegisterTpCompletion", then it works (unbelievable)!

The DomainService is marked with some attributes:

[EnableClientAccess()]
[RequiresAuthentication()]
public class NextTrainingProgramDomainService : DomainService

I managed to somehow log the server-side, and got the following exception from the WCF stack:

There is a problem with the XML that was received from the network. See inner exception for more details. at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, 开发者_运维问答Stream inputStream) at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream) at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception& requestException) at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, Action callback) at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state) at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

So for some unknown reason the clint (SL-app) does not flush properly the request? I'm starting to worry :(((

My callers (SL client) are authenticated with custom forms authentication.

I know you could say, leave it then as it is, but this drives me crazy, I want to know what's the problem, so I do not run into it again.

Thanks!

Bye, Csabi


I suspect it is URL issue, mostly URL can only be few kbs long. Now I don't know the size but in RIA services, it uses URL to send your filter as querystring.

And names of your method are also big, it is reaching max limit of URL. When it is working even with big name your filter part may be empty but if you add more filters you will face errors.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜