WCF 多主机标头
我创建了一个 wcf 服务,并将其上传到我的主机(使用 IIS)。一切正常。 所以,如果我去 http://www.mydomain.com/path/Service.svc< /a> 工作正常。 如果我去 http://mydomain.com/path/Service.svc 我会得到一个找不到资源错误。
我在路径文件夹下创建了一个clientaccesspolicy.xml,其中包含以下内容:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="http://*"/>
<domain uri="http://www.mydomain.com/path/*" />
<domain uri="http://mydomain.com/path/*" />
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
但它似乎没有任何效果。在网上查看过,但没有找到有关如何解决此问题的合理解释。有什么想法吗?
谢谢。
I have created a wcf service that i have uploaded to my host (using IIS). Everything works fine.
So, if i go to http://www.mydomain.com/path/Service.svc it works fine.
If i go to http://mydomain.com/path/Service.svc i get a resource not found error.
I have created a clientaccesspolicy.xml under the path folder which contains the following:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="http://*"/>
<domain uri="http://www.mydomain.com/path/*" />
<domain uri="http://mydomain.com/path/*" />
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
but it doesnt seem to have any effect. Have looked on the web but didnt find a decent explanation on how this is solved. Any ideas?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在 IIS 上添加更多主机标头。请查看此处:如何使用一个 IP 地址创建多个网站
You should to add more host headers on IIS. Take a look here: How to Create Multiple Websites with one IP address