Friday, March 7, 2008

Customising the WebService Help Page

I remember someone asking this question when I was in a course a long while back and the trainer had said, yeah it can be done,but he didn't tell us how :)

So some years later I'm gonna show you how.

The trick is in the Web.Config. Inside System.web you can set up a WebServices Tag and then include a wsdlHelpGenerator Tag to place your settings. Some options are now available:

Turn of ALL WSDL and Help!!
<System.Web>
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>

Or you can point it to your own file:
<webServices>
<wsdlHelpGenerator href="Default.aspx"></wsdlHelpGenerator>
</webServices>


But like this you have to do the whole page again yourself, there must be an easier way to just add some custom bits like a compnay logo, contact details etd, well there is. If you dig around, %Windows%\Microsoft.NET\Framework\v2.0.50727\CONFIG you'll find a file called DefaultWsdlHelpGenerator.aspx. Now you know what you have to do: Copy it and customise it :) if you want just your webservice changed, or alter it to alter all WebService DOcumentation across the whole machine!!

No comments: