There is two way to restrict the user to access the web service from browser.
Method : 1
<system.web>
<webServices>
<wsdlHelpGenerator href="CustomPage.aspx"></wsdlHelpGenerator> /
</webServices>
</system.web>
We have to create CustomPage.aspx page that will redirect into when try to access service.asmx file. It is restrict the user to invoke the web method via browser. Suppose if creating a new client application to consume the service, you could access the wsdl like Service.asmx?wsdl
Method: 2
<system.web>
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>
</system.web>
Removing the documentation protocol and it won't allow us to access the WSDL like Service.asmx?wsdl
Method : 1
<system.web>
<webServices>
<wsdlHelpGenerator href="CustomPage.aspx"></wsdlHelpGenerator> /
</webServices>
</system.web>
We have to create CustomPage.aspx page that will redirect into when try to access service.asmx file. It is restrict the user to invoke the web method via browser. Suppose if creating a new client application to consume the service, you could access the wsdl like Service.asmx?wsdl
Method: 2
<system.web>
<webServices>
<protocols>
<remove name="Documentation"/>
</protocols>
</webServices>
</system.web>
Removing the documentation protocol and it won't allow us to access the WSDL like Service.asmx?wsdl
Comments
Post a Comment