2

在我的NinjectWebCommon类在App_start中运行之后,我将我的 WCF 接口绑定到如下服务:

public static void LoadModules(IKernel kernel)
{
    kernel.Bind<IAccountService>().To<WCFAccountService>();
}

如何告诉系统接受对IAccountService的WSHttpBinding调用?

这是我的 .svc 供参考:

<%@ ServiceHost Language="C#" Debug="true" 
    Service="AAA.AAA.AAA.WCFAccountService" 
    Factory="Ninject.Extensions.Wcf.NinjectServiceHostFactory" %>

(注意:我正在使用Ninject.Extensions.Wcf并且只有BasicHttpBinding似乎“开箱即用”)

4

1 回答 1

4

您需要在 web.config 中配置服务,例如

  <service name="AAA.AAA.AAA.WCFAccountService" behaviorConfiguration="AAA.AAA.AAA.WCFAccountServiceBehavior">
    <endpoint name="IAccountService" address="" binding="wsHttpBinding" contract="AAA.AAA.AAA.IAccountService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
于 2013-01-09T01:41:32.580 回答