使用WCF服务托管Silverlight页面时出现问题 [英] Problem Hosting Silverlight Page with WCF Service

查看:120
本文介绍了使用WCF服务托管Silverlight页面时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有WCF服务参考的Silverligth应用程序.

从Visual Web开发人员构建数据时,一切正常,它能够从SQL Server和Service打算执行的所有操作中检索数据.

问题是当我尝试独立使用Apache服务器托管Silverlight页面时,出现此错误:
--------------------------------->
操作期间发生异常,使结果无效.检查InnerException以获取异常详细信息.
在System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
在SilverlightApplication11.ServiceReference1.DoWorkCompletedEventArgs.get_Result()
在SilverlightApplication11.About.client_DoWorkCompleted(Object sender,DoWorkCompletedEventArgs e)
在SilverlightApplication11.ServiceReference1.Service1Client.OnDoWorkCompleted(对象状态)
-------------------------------->

任何人都对如何解决此问题或如何使其起作用有任何想法.
预先感谢.

我已从apache服务器更改为内置Windows Xp IIS(版本5.1),但问题仍然相同..

您希望查看的任何特定代码段,请发表评论,我将粘贴很多代码段.

I have a Silverligth Application with a WCF service Reference.

When building it from the Visual Web developer Every thing works fine.It is able to retrive the Data from the SQL server and everything the Service is intended to do.

The problem is when i try to host the silverlight page using Apache server independently i getting this error:
--------------------------------->
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at SilverlightApplication11.ServiceReference1.DoWorkCompletedEventArgs.get_Result()
at SilverlightApplication11.About.client_DoWorkCompleted(Object sender, DoWorkCompletedEventArgs e)
at SilverlightApplication11.ServiceReference1.Service1Client.OnDoWorkCompleted(Object state)
-------------------------------->

Anybody have any idea on how to resolve this or how to get it working.
Thank in advance.

I have changed from apache server to the inbuild Windows Xp IIS ( Version 5.1 ) bu the problem remain the same ..

Any particular section of code you woulf like to see please comment i would paste the snippets that alot.

推荐答案

请确保服务器上Web服务的URL正确.

您将需要保持URL动态(如从文本文件或数据库中加载),以便可以在需要时进行更改-无需编译代码.
Make sure the URL to the web service is correct on the server.

You will need to keep the URL dynamic (as in load from a text file or database) so that you can change this as and when required - without compiling your code.


这篇关于使用WCF服务托管Silverlight页面时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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