C# 将 WebService 封装成动态库
服务与服务之间的远程调用,经常会通过Web Service来实现,Web Service是支持跨语言调用的,可以是java调用c++或c#调用java等,那么怎么把Web Service调用封装成动态库呢,下面就来介绍下如何封装
1.启动webservice服务,访问wsdl,出现该页面表示发布成功
2.进入开始菜单,找到Visual Studio 2015,运行VS2015 开发人员命令提示
3.运行wsdl 命令
wsdl http://localhost:8901/webservice.asmx?wsdl
也可将别人的webservice 的 wsdl下载到本地,用路径也可以生成.cs文件。
例如:wsdl C:UsersJoseDesktopwebservice.wsdl
4.运行完成之后,目录下会生成一个webservice.cs文件;此时就可以拷到项目里使用了
5.也可以生成动态库
6.这样就可以直接将dll引用到项目里使用了
注:在此将特别鸣谢“龙哥”的指导!!!