bzamfir
bzamfir

Reputation: 4896

REST help page and REST Test client in MVC4 WebApi

I developed several REST services using an early version of webapi (0.6.0), and for My services I enabled help page and Test client in as below in RegisterRoutes (called from application_start:

routes.Add(new ServiceRoute("auth", 
            new HttpServiceHostFactory() 
                { 
                    Configuration = new HttpConfiguration() 
                    { 
                        EnableTestClient = true, 
                        EnableHelpPage = true
                    } 
                }, 
typeof(Auth_Api)));

So I was able to access service at

http://<myserver>/auth

and access help page and test client at

http://<myserver>/auth/help
http://<myserver>/auth/test

Now I need to migrate them to MVC4 webapi, and I would like to accomplish the same behaviour, regarding test and help page, but I cannot find how to do it.

In RegisterRoutes I have this code which setup routes for API (REST) functionality

routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
            defaults: new { id = RouteParameter.Optional }
        );

Can I add System.ServiceModel.Activation and Microsoft.ApplicationServer.Http.Activation assemblies to MVC4 webapi app and set the routes as before?

Any drawbacks if I do it this way (in case it works)?

Thanks

Upvotes: 0

Views: 1112

Answers (1)

Darrel Miller
Darrel Miller

Reputation: 142094

Look at the API Explorer for the ability to generate Help pages. I believe the Test client has been dropped for the moment. I think there are plans to bring it back. I don't remember exactly.

Upvotes: 1

Related Questions