A web service is a proxy between a web
- Step 1
Open the web.config file in the Visual
Studio. A web.config file is specific to the web application, so the project needs to be loaded.
- Step 2
Enter the following code into the protocol XML tag. This allows the web service application to accept incoming "get" calls from a remote client. The code below also shows how to configure the web service for "post" calls.
- Step 3
Enter settings in the machine.config file. The difference between the web.config and the machine.config is that machine.config is a global solution. Settings entered into this file affect all applications. Using a web.config only changes settings for that specific web service. The code below is placed in the machine.config file in the protocol tabs. Machine.config is located in the C:\Windows\Microsoft.NET\Framework\
\config directory. The " " is the .NET version used on the web server.
This code snippet allows access from the local host for SOAP, post, and get calls.
- Step 4
Test the settings. Open a web browser and navigate to the web service using the "get" call. The get call is conducted through the query string in the browser. For instance, localhost/webservice/service.asmx?function=load&firstname=stacy is a get call to the web service. The function and first name variables are picked up by the web service "get" procedure and processed for results.