Silverlight 应用程序无法访问 clientaccesspolicy.xml 和 crossdomain.xml,并出现 Http-error 401
我们尝试在 Silverlight 应用程序中使用我们自己的 Web 服务,但总是收到此错误:
尝试创建时发生错误 对 URI 的请求 'http://blablabla:7777/blabla.svc'。 这可能是由于尝试 跨域访问服务 没有适当的跨域策略 已到位,或已制定政策 不适合 SOAP 服务。您可以 需要联系业主 发布跨域服务 策略文件并确保它允许 要发送的 SOAP 相关 HTTP 标头。 此错误也可能是由使用引起的 Web 服务中的内部类型 代理而不使用 InternalsVisibleToAttribute 属性。 请参阅内部异常 更多详细信息。
在互联网上搜索后,我们非常非常沮丧......似乎没有任何效果,但最终我们从一个网站得到了解决方案,该解决方案是由一个非常著名的网站翻译成英语的:-)))。根据此信息,我们必须转到 IIS,打开我们的站点,然后选择“身份验证”->“身份验证”。选择匿名验证->在右上角选择编辑... ->并确保匿名用户的身份设置为:应用程序池的身份(希望这是从德语到英语的正确翻译 - 它应该是第二个单选按钮。)。
我希望这能帮助那里的人!
感谢您的阅读! 哈利
We tried to consume our own webservice from within a Silverlight application and we always got this error:
An error occurred while trying to make
a request to URI
'http://blablabla:7777/blabla.svc'.
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.
After searching the internet we were very very frustrated...nothing seemed to work, but finally we got the solution from a site, which was tranlated from by a very famous Site to English :-))). According to this information, we had to go to the IIS, open our Site, then select Authentification -> select Anonymous Authentification -> in the right upper corner select edit... -> and ENSURE THAT THE IDENTITY OF THE ANONYMOUS USER is set to: Identity of the applicationpool (hope this is the correct translation from German to English - it should be the second radiobutton.).
I hope this will help somebody out there!
Thanks for reading!
Harry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于我们来说,这就是解决方案 - 互联网上的许多网站告诉您要注意根目录中的 clientacccesspolicy.xml 和 crossdomain.xml 文件,我们认为我们做错了什么,但我们没有。如果您遇到同样的问题,也许您可以尝试此解决方案。
For us this was the solution - a lot of sites in the internet tell you to take care that you have your clientacccesspolicy.xml and crossdomain.xml file in your root directory and we thought we did something wrong, but we did not. Maybe you try this solution if you run into the same problem.