Always we are looking to secure our application and services, in this
part am sharing few simple way to secure web service. Suppose you want to
invoke web service in local machine and hide the invoke section in remote
machine that case you could do enable the following properties in web.config
file.
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
Adding HttpGet and HttpPost in web.config to make your web service in
invoke only in local machine.
Suppose want to show custom splash page or helper page,
whenever accessing the web service landing page (.asmx). The following code
helps to accomplish
<system.web>
<webServices>
<wsdlHelpGenerator href="splash.aspx"></wsdlHelpGenerator> /
</webServices>
</system.web>
<webServices>
<wsdlHelpGenerator href="splash.aspx"></wsdlHelpGenerator> /
</webServices>
</system.web>
Remove the documentation of web service and
throwing error, while access the web service. You could do by
<system.web>
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>
</system.web>
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>
</system.web>
Comments
Post a Comment