Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example to replace the obsolete NinjectWebServiceHostFactory and use NinjectServiceHostFactory #34

Open
adrianhalid opened this issue May 6, 2015 · 2 comments

Comments

@adrianhalid
Copy link

I am trying to figure out how to expose my service as a REST service and not use the now obsolete NinjectWebServiceHostFactory.

In the example Ninject.Extensions.Wcf/src/Examples/WcfRestService/Global.asax.cs it uses the obsolete NinjectWebServiceHostFactory.

RouteTable.Routes.Add(new ServiceRoute("Service1", new NinjectWebServiceHostFactory(), typeof(Service1)));

So when I change it to the code below I can no longer send application/json requests to it. It complains and says it is expecting xml.

RouteTable.Routes.Add(new ServiceRoute("Service1", new NinjectServiceHostFactory(), typeof(Service1)));

How do I use the NinjectServiceHostFactory and create my route as a REST route.
Should NinjectWebServiceHostFactory really be obsolete?

@xanothos
Copy link

Same issue - can't find anything about how to use NinjectServiceHostFactory.
readme.md states:
Ninject.Extensions.Wcf.NinjectWebServiceHostFactory is used for REST services
ReleaseNotes.md states that as of version 3.2.0:
Added: Endpoints can now be configured in the app config. Rest service and mex bindings can now be used together with NinjectServiceHostFactory. Marked NinjectWebServiceHostFactory obsolete
So which should be used?

@blyry
Copy link

blyry commented Jan 14, 2016

Right? The whole point of using the WebServiceHostFactory for me was to /avoid/ app.config configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants