4.2.
Using a wizard/tool to generate a proxy class
Visual Studio.NET has a wizard that automatically
generates the code of a class ...
... that looks similar to the class
of the Web Service.
This class is called a
proxy class.
When you use Visual Studio.NET's wizard,
you supply it with the Web Service's URL.
It then goes away to the appropriate webserver to query
the Web Service ...
... to discover the methods
that the Web Service is providing ...
... together with their parameters and return types.
For each method of the Web Service that has a WebMethod
attribute, ...
... the wizard will generate the code of
a method that has the same parameters
and the same return type.
So if you want to call a method of the Web Service,
you instead call the method of the proxy class that has the
same name.
Behind the scenes,
the call of the method of the proxy class
creates the HTTP request;
sends it to the webserver providing the Web Service;
waits for the reply;
and then decodes the reply that is returned by the Web Service.
If you have not got Visual Studio.NET,
you can instead generate a proxy class with a tool
called wsdl.exe.