Search code examples
asp.netsilverlightwcf-ria-services

How to Get WCF RIA service URL


I have created a WFC RIA Service based on ASP.Net Website and adding the nuget packages for RIA service. I have also created a Service named "FactoryService" by extending DomainService class.

I have tested the service by creating a GridView with DomainDataSource pointing to the service. The service is working.

Now I want to access the service from other clients as I have enabled SOAP endpoint. But I cannot find the service's url to the svc file. I need this url to add service reference to my other projects. How do I find the service url?

I have tried the following urls and all returns 404. (namespace "WebApplication3", DomainService class "FactoryService").

 - http://localhost:15066/WebApplication3-FactoryService.svc
 - http://localhost:15066/services/WebApplication3-FactoryService.svc
 - http://localhost:15066/ClientBin/WebApplication3-FactoryService.svc
 - http://localhost:15066/FactoryService.svc
 - http://localhost:15066/services/FactoryService.svc
 - http://localhost:15066/ClientBin/FactoryService.svc

Solution

  • I have found the problem. In the DomainService class, I missed to annotate it with [EnableClientAccess()].

    A domain service class must be marked with the EnableClientAccessAttribute attribute to make the service available to the client project. The EnableClientAccessAttribute attribute is automatically applied to a domain service when you select the Enable client access check box in the Add New Domain Service Class dialog box.

    As I'm using VS2013, the wizard is not available and missed to annotate it with the attribute.