문제

After my NinjectWebCommon class has run in App_start I then bind my WCF interfaces to services like this:

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

How do I tell the system to accept WSHttpBinding calls to IAccountService ?

Here's my .svc for reference:

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

(Note: I'm using the Ninject.Extensions.Wcf and only BasicHttpBinding seems to work 'out of the box')

도움이 되었습니까?

해결책

You need to configure the service in the web.config like

  <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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top