开发者

How does one expose a WCF Syndication Service Library for URL access?

开发者 https://www.devze.com 2023-02-17 22:28 出处:网络
Using VS 2010, I\'ve created a WCF Syndication Service Library, that debugs fine--browser shows the feed I created and everything.

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 fe开发者_高级运维ed. 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消