Silverlight 应用程序中的 Sql Server Reporting Services Web 服务访问问题
我希望你能帮助我解决这个问题...:)
我有一个 .net 应用程序,其中包含一个 Silverlight 组件。
我还安装了带有 Reporting Services 的 Sql Server 2008 R2。
SSRS 已作为 Web 服务参考添加到 Silverlight 应用程序中。
以上全部运行在一台开发机器上(所以我认为没有跨域的东西,我是 SSRS 和 Web 服务的新手)。
我遇到的问题是 - 当我从 Silverlight 应用程序中的 SSRS Web 服务引用类调用/尝试访问 SSRS Web 服务 .asmx (http://localhost/ReportServer_sql2008r2/ReportService2010.asmx) 时,我收到以下错误消息:-
'尝试向 URI 发出请求时发生错误 'http://localhost/ReportServer_sql2008r2/ReportService2010.asmx'。这 可能是由于尝试以跨域方式访问服务 没有适当的跨域策略,或者策略 不适合 SOAP 服务。您可能需要联系该物品的所有者 服务发布跨域策略文件并确保它允许 要发送的 SOAP 相关 HTTP 标头。此错误也可能是由以下原因引起的 在 Web 服务代理中使用内部类型而不使用 InternalsVisibleToAttribute 属性。请查看内部异常 了解更多详情。'
我对错误消息的想法 - 我认为有关跨域策略的内容是无关紧要的,因为此设置全部在一台计算机上。除此之外我不知道该寻找什么。我搜索了两天,甚至开始阅读有关代码访问安全性、CAS 的内容,但不确定这是否是问题的根源。
任何想法将不胜感激。如果您需要更多信息没问题。
谢谢罗布
I hope you can help me with this one... :)
I have a .net application which holds a Silverlight component.
I also have Sql Server 2008 R2 with Reporting Services installed.
The SSRS has been added to the Silverlight App as a Web Service Reference.
The above is all running on one development machine (so no cross domain stuff I think, I'm new to SSRS and Web Services).
The issue im having is - when I call/try to access the SSRS web service .asmx (http://localhost/ReportServer_sql2008r2/ReportService2010.asmx) from the SSRS web service reference class in the Silverlight App, I get the following error message:-
'An error occurred while trying to make a request to URI
'http://localhost/ReportServer_sql2008r2/ReportService2010.asmx'. This
could be due to attempting to access a service in a cross-domain way
without a proper cross-domain policy in place, or a policy that is
unsuitable for SOAP services. You may need to contact the owner of the
service to publish a cross-domain policy file and to ensure it allows
SOAP-related HTTP headers to be sent. This error may also be caused by
using internal types in the web service proxy without using the
InternalsVisibleToAttribute attribute. Please see the inner exception
for more details.'
My thoughts on the error message - I think the stuff about cross domain policy is irrelevant, as this set up is all on one machine. Other than that I don't know what to look for. I searched on this for 2 days and even started reading about Code Access Security, CAS, but not sure if that is the source of the problem.
Any any thoughts would be much appreciated. If you need more info no problem.
Thanks
Rob
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果此错误发生在客户端上,则可能需要了解您如何访问 SL 页面。如果您通过域访问它,即: http://Mycompanyname.com/,则“localhost”引用可以被视为跨站点
If this error is happening on the client, it might be relevant to know how you are accessing the SL page. If you are accessing it by domain, ie: http://Mycompanyname.com/, then the "localhost" reference can be considered cross site