web sevice 生成代理类及使用

一、生成代理类:

VS2008下这样写 wsdl.exe /l:cs /out:D:/ProxyServices.cs http://localhost/WebService.asmx

VS2010下这样写 D:VS2010VC>wsdl.exe /l:cs /n:Computer /out:Computer.cs http://localhost:8111/

参数解析:

wsdl.exe是vs自带的命令行 

/l:cs 是 输出language,cs是csharp(c#)。选项可以为:“CS”、“VB”、“JS”、“VJS”、 “CPP”

/n:wsdllib  (n = namespace)是生成代理类的命名空间。

/out  是输出路径,生成的代理类。

二、直接对生成的代理类进行实例化调用,跟正常的类使用方式一样。

原文地址:https://www.cnblogs.com/xbding/p/4810307.html