Project Description Autodocs is an automatic API documentation generator for .NET applications that use Windows Communication Foundation (WCF) to establish REST API's.
-
Download library and reference Autodocs.ServiceModel.Web.dll in your WCF WebServices project
-
Modify the Web.config's system.ServiceModel section of the WCF WebServices project as illustrated below a) Add a behavior extension {code:xml}
b) Reference the behavior extension in endpoint behavior {code:xml} {code:xml} Here is a sample Web.config
Note: It's very important to maintain the order of behaviors, in the endpointBehaviors element. If you specify autodocs first, you might not get the desired documentation, as webHttp will override autodocs message inspectors
c) Start documenting your Service interface as shown below {code:c#} [WebServiceDoc(Title="Users REST API Documentation", Description = "Web Services API for user management in the foo system.", SupportLink = "mailto:santthosh@notionforge.com")] {code:c#} d) Start documenting your Operations as shown below {code:c#} [WebOperationDoc(Description = "Update an existing user in the system. If UserId is invalid, null or doesn't exist it throws HTTP 404 - Not found.")] {code:c#} e) Deploy or launch your service, the documentation should be automatically availabe in '/docs'
Service Documentation: http://servername/{servicename}.svc/docs (http://myserver/users.svc/docs)
Operation Documentation: http://servername/{servicename}.svc/{operation}/docs (http://myserver/users.svc/adduser/docs)
Screen Shots
a) Sample Service Documentation
b) Sample XML Operation Documentation
c) Sample JSON Operation Documentation
Thank you!