码迷,mamicode.com
首页 > 其他好文 > 详细

WCF: Generate Proxy Class and Configuration file for Client

时间:2017-06-14 02:23:57      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:com   man   get   ted   resource   host   file path   generated   intro   

1. please keep WCF service running

2. and two ways to achive this 

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

  b. use svcutil.exe to generate

use svcutil.exe to generate

a. open visual studio cmd and input commands as below

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

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

  - config means config file path

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

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

技术分享

 

WCF: Generate Proxy Class and Configuration file for Client

标签:com   man   get   ted   resource   host   file path   generated   intro   

原文地址:http://www.cnblogs.com/ATually/p/7004419.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!