views:

668

answers:

5

We have this nice Silverlight 3 application that communicates with a web server running some WCF web services. It works well when it is running in the browser, but at soon we try to run it outside the browser it doesn't call our webservices.

I have tried to find out why this is happening, but I can't find any explanation.

When attaching the debugger to the sllauncher.exe process I am able to step through the code and I can see that the (Begin)Async method is called. But using Fiddler I can see that there is no traffic to the server at all!

I have also verified that the endpoint address is correct and that the endpoint is properly configured (it works when running in the browser after all).

So I am wondering what can be the cause of the problem and how to debug it. Any ideas?

EDIT: I noticed that our application doesn't run in Internet Explorer either. But it runs fine in Firefox! This isn't much of a surprise since the out of browser application embeds internet explorer, but it may be a clue to our problem.

So, do you know of any differences between hosting silverlight in Firefox versus Internet Explorer?

+1  A: 

Maybe worth putting a try catch around your web service call and see what exception is thrown to help further debug this issue as webservices that work ok in browser should work OOB as far as I'm aware.

Andy Britcliffe
I tried it, but there is no exception. :-(
Rune Grimstad
+1  A: 

The issues we have experiences with OOB have all had to do with local machine setup. If you are behind a proxy, turn it of temporarily. Also check your firewall to ensure it will let the web service traffic through.

For easier debugging, if you have not already done so, wrap your service calls like this:

using System.Net;

if (NetworkInterface.GetIsNetworkAvailable()) { doSomethingAsync(); }
else { //Report the error or show status in UI }
PortageMonkey
Good points, but I don't think either are the cause of my problem. I have tried running the webservices locally and on a remote server but the behavior is the same. I also tried to call GetIsNetworkAvailable but it returns true.
Rune Grimstad
Hmmm....How is your client access or crossdomain policies configured?
PortageMonkey
Ahh...there are some IE settings regarding active X controls etc that can cause SL OOB apps not to run. If you can, rest all IE settings to default and then try to run it.
PortageMonkey
A: 

i am facing same Issue. when i run silverlight application in browser, it runs fine. But when i run it in OOB then application calls for service and then it keep on waiting for responce. can any one help

Usman
+1  A: 

I have the same issue. WCF service calls work fine in browser - but in my case it only works about 30% when run from OOB.

John K
A: 

It works in Firefox and not IE, because firefox is alot more willing to accept temporary certificates. Are you running a certification server?

The reason no traffic hits fiddler is because either

  1. You have no clientaccesspolicy.xml on the HTTPS address you are accessing.
  2. you are running the Silverlight app from within visual studio, hence running the website that hosts the SL clientbin from within visual studio, the ASP development server prevents certain calls from being made, esp if your webservice address is different from the address that the website is hosted on and certain ports dont respond resulting in the most odd behavior of fiddler doing absolutely nothing.

Either way the behavior of the SL app not contacting the web server when using HTTPS, is due to the hosting environment restrictions (try deploying in IIS) or the willingness of the client to accept the certification encryption strategy.

Neil