如何公开 WCF 联合服务库以进行 URL 访问?

发布于 2024-10-24 03:17:42 字数 345 浏览 1 评论 0原文

使用 VS 2010,我创建了一个 WCF 联合服务库,该库调试良好 - 浏览器显示我创建的提要和所有内容。

问题是:我把这个服务库发布到Server 08R2上的IIS 7的一个应用程序目录中。发布创建了一个 bin 目录,其中包含 servicelibrary.dll、.svc 文件和 web.config。我可以通过浏览器访问该服务,但无法获取提要。我只是得到“您已经创建了一项服务。要测试该服务...等等”

如果有人有这方面的经验,我真的很感激。我还没有找到太多关于部署它以在应用程序之外使用的文档。我希望我可以只提供此提要的 URL 链接供人们订阅,而不必在某处放置 xml 文件。

是我错过了什么,还是我期待太多?

Using VS 2010, I've created a WCF Syndication Service Library, that debugs fine--browser shows the feed I created and everything.

The problem is: I published this service library to IIS 7 on Server 08R2 to an application directory. The publish created a bin directory with the servicelibrary.dll, an .svc file, and a web.config. I can access the service via browser, but I do not get the feed. I just get the "You have created a service. To test this service... etc"

If anyone has any experience with this, I'd really appreciate a heads up. I haven't found much documentation about deploying this for use outside of an application. I was hoping I could just provide URL links to this feed for people to subscribe to without having to have an xml file sitting somewhere.

Am I missing something, or am I expecting too much?

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

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

发布评论

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

评论(2

未蓝澄海的烟 2024-10-31 03:17:42

通过 WCF 联合服务项目(RSS 提要服务器),我也获得了有关命令行测试客户端的说明页面。这很令人困惑,因为它似乎与您的服务有联系,而实际上显示了其他内容:P

原因结果是一个初学者错误:没有正确解决 .svc 中的 ServiceContract。

在 wwwroot\virtualdir 上发布并将虚拟目录连接到 IIS(默认文档)中的服务后,当我浏览到..

http://MyMachine/virtualdir/MyService.svc

期待 RSS 提要概述..我得到了解释页面。但是

http://MyMachine/virtualdir/MyService.svc/MyBlog

工作正常。

说明:MyBlog 是我实现 ServiceContract 的类的名称,名为 IMyBlog。服务库 MyService.svc 可以包含更多多于一个 ServiceContract,因此 url 中需要该名称。

With a WCF syndication service project (RSS feed server), I got this explanation page about commandline test clients too. It is confusing, because it seems there is connection with your service, while actually something else is shown :P

Cause turned out to be a beginner error: not addressing the ServiceContract within the .svc properly.

After publishing on wwwroot\virtualdir and connecting the virtual dir to the service in IIS (default document), when I browsed to..

http://MyMachine/virtualdir/MyService.svc

expecting RSS feeds overview..I got the explanation page. But

http://MyMachine/virtualdir/MyService.svc/MyBlog

worked fine.

Explain: MyBlog is the name of my class implementing ServiceContract named IMyBlog. Service library MyService.svc can contain more than one ServiceContract, so the name is needed in the url.

我只土不豪 2024-10-31 03:17:42

当时的答案并不完全明显,就是向项目中添加一个 .svc 文件,该文件的“Service”属性指向联合服务库中声明的命名空间。

如果有人遇到类似的问题并需要更多解释,我很乐意提供更详细的信息。

The, not entirely obvious at the time, answer to this was to add an .svc file to the project whose "Service" attribute points to the namespace declared in the Syndication Service Library.

If anyone runs into a similar problem and requires more of an explanation I'll be glad to go into greater detail.

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