浏览器不足时从Silverlight 3调用Web服务 [英] Calling webservices from Silverlight 3 when running out-of-browser

查看:75
本文介绍了浏览器不足时从Silverlight 3调用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个不错的Silverlight 3应用程序,可以与运行某些WCF Web服务的Web服务器进行通信.当它在浏览器中运行时,它运行良好,但是很快我们尝试在浏览器之外运行它,它不会调用我们的网络服务.

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.

将调试器附加到sllauncher.exe进程时,我可以逐步执行代码,并且可以看到调用了(Begin)Async方法.但是使用Fiddler,我可以看到根本没有流量到服务器!

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?

我注意到我们的应用程序也无法在Internet Explorer中运行.但是它在Firefox中运行良好!自从浏览器外应用程序嵌入Internet Explorer以来,这并不令人感到意外,但这可能是解决我们问题的线索.

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.

那么,您是否知道在Firefox和Internet Explorer中托管Silverlight之间有什么区别?

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

推荐答案

我们在OOB上遇到的问题都与本地计算机设置有关.如果您是代理人,请暂时将其关闭.另外,请检查您的防火墙,以确保它将使Web服务通过.

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 }

这篇关于浏览器不足时从Silverlight 3调用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆