开发者

Mixing RIA services and standard WCF services

Is it possible to have a mix of RIA WCF services and custom WCF services hosted in the same project?

At the moment I have a server project hosting 2 RIA service classes, both of which work fine, and 1 WCF svc file, which loads up fine in the browser (e.g. http://localhost/services/service.svc) but when I access it through code in the Silverlight client, I'm getting a Not Found error.

I'm happy to keep debugging away until I resolve it, but开发者_开发百科 just thought I'd check to see if I was doing something stupid first...


The answer is yes, you just have to be careful how you set up your web.config. The new .NET 4.0 multipleSiteBindingsEnabled="true" caught me out. I provided a relative address in the endpoint address, e.g.

/services/myservice.svc

but in the metadata this ended up being resolved to:

http://localhost/services/myservice.svc/services/myservice.svc

Which confused everything. Clearing out the address attribute of the endpoint and updating the references made everything work.


Yes, you should be able to host RIA and plain WCF services in the same project. Until now, I hadn't heard anybody report difficulty hosting them together.

Kyle

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜