WCF 休息帮助页面

发布于 2024-08-22 05:36:34 字数 586 浏览 2 评论 0原文

如何将 WCF REST 服务 UriTemplate 更新为 www.mysite.com/... 而不是系统名称 http://mysystem/ ...

当我转到服务帮助页面时,我看到系统名称,但我不希望最终用户看到该名称。

http://myServerName.local/WCF/Svc.svc/blah/function

我想看看

http://www.mysite.com/WCF/Svc.svc /blah/函数

我想这是我可以在 web.config 中更新的东西?

How can I update a WCF REST services UriTemplate to be www.mysite.com/... instead of the system name http://mysystem/...

When I go to the service help page I see the system name and I don't want the end user to see that.

http://myServerName.local/WCF/Svc.svc/blah/function

I want to see

http://www.mysite.com/WCF/Svc.svc/blah/function

I would imagine this is something I can update in the web.config?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花开浅夏 2024-08-29 05:36:34

像这样装饰你的操作合约:

[Description("www.mysite.com")]
string EchoWorld();

Decorate your operation contracts like this:

[Description("www.mysite.com")]
string EchoWorld();
我很OK 2024-08-29 05:36:34

我不相信你可以。 UriTemplate 属性仅用于路径解析。服务帮助页面完全从服务的主机生成链接,因此从这个意义上说,如果您希望服务主机的基地址反映在帮助服务页面中,则必须更改服务主机的基地址。

I don't believe you can. The UriTemplate attribute is used for path resolution only. The service help page generates the links completely from the host for the service, so in that sense, you would have to change the base address of the service host if you wanted it reflected in the help service page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文