You may ask, "Why remove public access to a Web service?" Many developers view Web services as a public, freely consumable service where any consumer may discover a Web service and implement it in his or her own applications. While this scenario is true, there are many situations where you may not want your Web service publicly available. For example, a large organisation with multiple office locations throughout the country, each with a custom internal solution that communicates with the other offices via Web services may want a private Web service. Or perhaps you're working in an organisation that implemented a new cutting-edge system of delivering complex information via Web services, and you want to charge your clients for utilising this service. In both of these examples, the target audience of your Web service is definitive and must be controlled by the implementer of the Web service, restricting access to those who aren't authorised. If you require a private Web service, it isn't enough simply to hope that nobody happens to guess what and where your Web service is. Restricting access to authorised consumers won't prevent others from manually discovering your Web service on the Internet; reading its WSDL description; revealing all of its methods, parameters, and return values; and implementing the Web service in their own application -- even though they will be denied access due to the SOAP Header security. The fact is, if it exists and is public, it will be found. Web.config
The first step in making your Web services private is to put them into their own directory. This is also a good practice for organisational purposes. Once your Web services are in their own directory, you can add a Web.config file that applies to that directory only. Every ASP.NET application generated by Visual Studio .NET automatically has this file inserted at the root of the project and is responsible for the configuration settings of the entire ASP.NET application. The Web.config file contained in the root of the project is the only file that may contain application-specific configurations, because the configurations may be only declared once globally for the entire application. However, every subdirectory in an ASP.NET application may contain its own Web.config file with specific instructions for security, authentication, protocols, etc. If you use Visual Studio .NET, the software will insert a template Web.config file containing all of the XML nodes available in the root Web.config file. However, since this new Web.config file resides in a subdirectory, your project will not execute correctly because many of the definitions are restricted to the root Web.config file and cannot be duplicated. To make your Web.config file in your Web service subdirectory compile correctly, you must do the following:
- Locate the
tag and the closing tag. - Delete everything in between these two tags with the exception of the
tag.
For a weekly round-up of the enterprise IT news, sign up for the Tech Update newsletter. Let the editors know what you think in the Mailroom.






Talkback
Why do I click on the Listing A hyperlink to only be taken to a page that is not listing A and has nothing to do with this article?
Hi,
Good day to you.
I am impressed after reviewing your web site and company services.
Here I would like to propose a "mission-critical" solution to boost your sales, marketing and customer service via your web site. We have a solution known as BOTizen | www.botizen.com that could complement your business to achieve great result.
We have a very interesting proposition to propose that could add value to your company’s services.
Can you please direct me to the appropriate person in charge so that I can get in touch with him/her immediately? I would appreciate if you could send me his/her name and e-mail address for contact.
Thank you very much.
Great!
But I can't found source code
For everybody who cannot open the Listings use this Link to view the Article
http://builder.com.com/5100-6389-5034851.html#Listing%20A
This is a great article but it seems that the code samples links are broken (Listing A and B) which is not too good. Do you have those available somewhere or updated links that you could send me?