WCF: Generate Proxy Class and Configuration file for Client

1. please keep WCF service runningc#

2. and two ways to achive this app

  a. add Service Reference (will not introduce this since there're so many resources on internet)this

  b. use svcutil.exe to generatespa

use svcutil.exe to generate3d

a. open visual studio cmd and input commands as belowcode

  - language means which language the code in GeneratedProxy uses. .cs mean c#blog

  - out means the output file into which the proxy class will be written.get

  - config means config file pathinput

  - URL means the wcf service URL from which we can get service metadata to generate client proxy class.cmd

svcutil.exe /language:cs /out:D:\GeneratedProxy.cs /config:D:\app.config http://localhost:8000/ServiceModelSamples/service

 

b. Check the generated proxy and config file

 

GeneratedProxy.cs

 

 app.config

相關文章
相關標籤/搜索