Orchard/MVC WCF Service Url with Area

后端 未结 1 1800
北恋
北恋 2021-01-07 05:53

Bertrand created a blog post to specify how to use IoC in WCF Modules for Orchard.

In 1.1, you can create a SVC file using the new Orchard host factory:



        
相关标签:
1条回答
  • 2021-01-07 06:28

    As you stated, Orchard modules are areas in ASP.NET MVC terms, so the URL you provided is incorrect and should be:

    http://localhost/Your.Orchard.Module/WebServices/MyService.svc
    

    Where localhost is the virtual directory under which your app runs and /WebServices is a folder in the root of your module.

    You can also create a service route programatically without problem. This article tells how to add new routes in Orchard. You can just assign a ServiceRoute to the Route property of a RouteDescriptor instead of a default MVC route (as shown in docs). The question about adding ServiceRoute in area-enabled ASP.NET MVC app was asked before, check it out as it may help you out.

    Btw - You may also check this SO question about prefixed service routes.

    HTH

    0 讨论(0)
提交回复
热议问题