开发者

Ideas for a generic WCF Result for Asp.Net MVC

First a bit of background:

We have a growing RESTful service layer supporting web pages, gadgets and now the iPhone.

These have been implemented in WCF using WebServiceHostFactory to expose JSON and XML endpoints, and we now have a nice backend for easily adding new REST endpoints for other areas of the business after a process of factoring out to patterns etc.

We've also made an authentication s开发者_开发技巧ervice layer which runs through WCF, incorporating also message inspectors etc to secure any WCF service called from any client.

Finally, we've also just finished building a proto of a multi-tenant version of our site that we can market to others. It runs on MVC 1.0 and incorporates custom view engines, a controller factory etc so that we can rebrand any part of the site (controls, pages, master pages, css, images and controllers) for a given brand whilst sharing anything that's common between them.

On to the question :)

So, now I want to see if I can port the WCF services we've written into the multi-branded website. What I want to do is to fire up a server-side request to an SVC service programmatically, i.e. spark up the WCF pipeline, in the same way that the WebFormViewResult manually hits the Asp.Net BuildManager and calls ProcessRequest on an Asp.Net page. Clearly I'll need to write a new ViewResult class (I'll need a custom viewengine as well, but let's leave that!).

Any ideas on how I could go about creating this? What's the BuildManager equivalent for WCF?

I'm thinking I'd have a special route defined for the .SVC pipe-through that allows me to incorporate all the URL data (i.e. UriTemplate parameters) that the WCF service expects so I can 'concoct' the environment that WCF would typically see when it does it's thing.


yay - I got a tumbleweed badge; something to tell the kids :)

I didn't intend it - but I guess my question might have been too long-winded and, well, strange ;)

I am going to investigate whether or not you can launch the WCF pipeline programmatically..

However, I think the answer is to use the URL rewriting module in IIS7 so I can virtualise the one service under all the different URLs that I'm gonna have.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜