5

Silverlight has completed events for WCF calls that do not work in Firefox

 2 years ago
source link: https://www.codesd.com/item/silverlight-has-completed-events-for-wcf-calls-that-do-not-work-in-firefox.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Silverlight has completed events for WCF calls that do not work in Firefox

advertisements

I've got this problem with completed events not firing for WCF long running calls (up to 1.5 minutes to return), it works ok in IE 8 but doesn't work in Firefox, Chrome or Safari. Looking in Fiddler the results clearly get returned, and as I said, it works ok in IE, so that side of things are obviously working.

Using a sample project, I've managed to narrow it down pretty well, it seems it's due to the fact that I'm using the Client HTTP Stack rather than the browser stack for networking.

Has anyone had much experience with the client http stack or come across this type of behavior before?

Similar things were happening in IE to start with, but increasing the timeout on the client side for the WCF service, solved that.

Any thoughts or suggestions would be greatly appreciated, as I've done a whole heap of searching around the web, without any luck :(

Cheers, Ola


I ended up reporting this here and it was recognised as a bug in Silverlight 4.

There's not been any resolution to the bug but they've found a workaround, here's the quote from the MS guy who replied to the bug report:

"While trying it out here, I've found that the event handler is invoked, but the e.Error property has a value. That means that you can't access e.Result (since there was an error in the event). If you change the implementation as shown below, you'll see that. However, we're still investigating why the client stack in firefox is behaving differently than the other browser (IE) or the browser stack in Firefox.

void client_DoLongTimeCompleted(object sender, DoLongTimeCompletedEventArgs e)
{
DateTime timeStamp = DateTime.Now;
if (e.Result == null)
{
    txtOutPut.Text += string.Format("\n{0} {1}", e.Result, timeStamp);
}
else
{
    txtOutPut.Text += string.Format("\n[{0}] Error: {1}", timeStamp, e.Error);
}
}"


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK