Generating Proxy Code Using svcutil.exe
The first way you can build a client-side proxy is to make use of the svcutil.exe command-line
tool. Using svcutil.exe, you can generate a new C# language file that represents the proxy code
itself as well as a client-side configuration file. To do so, simply specify the service’s endpoint as the
first parameter. The /out: flag is used to define the name of the *.cs file containing the proxy, while
the /config: option specifies the name of the generated client-side *.config file.
Assuming your service is currently running, the following command set passed into svcutil.
exe will generate two new files in the working directory (which should, of course, be entered as a
single line within a Visual Studio 2008 command prompt):
svcutil http://localhost:8080/MagicEightBallService
/out:myProxy.cs /config:app.config
C H A P T E R 2 5
Do'stlaringiz bilan baham: |