Skip to content

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

@adrianhalid

Description

@adrianhalid

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions