开发者

Running a .net 4.0 WCF data service on a subdomain

I have two domains running my WCF dat开发者_JAVA技巧a services:

  • a) http://www.domain-a.com/
  • b) http://api.domain-b.com/

When I address my service like this:

http://domain-a.com/odata.svc - IT WORKS.

When I address my service like this:

http://www.domain-a.com/odata.svc - I GET THE FOLLOW EXCEPTION:

Message: Service 'cf.Svc.odata_v0' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element. ExceptionStackTrace: at System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreApplicationEndpoints(ServiceDescription description) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) at

The problem, is that I need moving forward to run my service on:

http://api.domain-b.com/ and I do not have the option to reference it as http://domain-b.com/ because the root domain is already in use.

I even tried downloading the WCF Data Services Toolkit (http://wcfdstoolkit.codeplex.com/releases/view/65119) april release thinking I'd get around the problem with setting up a nice clean route - like:

http://api.domain-b.com/odata

But I'm still getting this error. Can anyone tell me what's going on?

My web.config looks like below - I am also running WCF Rest Services that do not have any issues in the same application.

<system.serviceModel> 
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
  <standardEndpoints> 
    <webHttpEndpoint> 
     <standardEndpoint name="" helpEnabled="true" 
                       automaticFormatSelectionEnabled="true" />
    </webHttpEndpoint> 
  </standardEndpoints>
</system.serviceModel>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜