惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
博客园 - 【当耐特】
V
Visual Studio Blog
GbyAI
GbyAI
V
V2EX
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
量子位
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件

博客园 - 丁丁

Running Knoppix 6.7.1 in a Sandisk Ultra flash drive to do GAE programming via PyCharm Fast fill huge number of same value to below cells in Excel How to install Windows 7 on the 6 years IBM X60 notebook Python 2.5 SSL package version 1.15 for GAE A GAE based blog, Micolog 7.412 with Django 1.2 enable Price compare: Sina App Engine vs Google App Engine IE9 is a little faster than Firefox6 in Speed Reading performance test but so less SDLC (Systems Development Life Cycle) Brief Terminology & Workflow 成功凤凰刷机刷出诺基亚E5系统版本042.014纯净简体中文版 How to using Windows Live Writer on umbraco - 丁丁 用PowerShell强制添加IE本身无法添加的RSS Feeds Getting Help on WMI Methods - 丁丁 [PowerShell]One line to pack individual PDF file into their BaseName.RAR - 丁丁 My first time meet ORA-600 error, quite memorable moment. Camstar InSite 3 server transaction log file profiler, source code included Setting up the Matlab Database Toolbox to connecting to Oracle DB 在Ubuntu 8.04 x86_64上安装Oracle 10g XE和Oracle Application Express(apex) 3.1.1 究竟何时买房才最合适?写于2008年3月 代码小片断,自动对文本分行的C#函数
合并不同WebService之间的相同对象类型
丁丁 · 2008-04-30 · via 博客园 - 丁丁

在.NET中使用WebService极其简单,只要添加Web引用即可,然后IDE就会帮你搞定所有一切,但这样做有个缺点,VS.2005的IDE生成的对应每个Web Service的WebServiceProxy类都有自己独立的命名空间,这导致了即使相同的.NET类型,发布在不同的WebService之后,生成的WebServiceProxy类型都在各自的独立命名空间中,结果就是在客户端中使用这些.NET类很麻烦。

其实在.NET中共享不同Web Service只见相同的对象类型是完全可以的,使用命令行方式调用wsdl.exe就可以:

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\wsdl.exe" /nologo /language:cs /sharetypes /out:MES_WebService.cs /namespace:TRG_MES.MES_WebService http://localhost/MES_Srv/WIP_Workflow.asmx?WSDL http://localhost/MES_Srv/WIP_Transaction.asmx?WSDL http://localhost/MES_Srv/SYS_SiteInfo.asmx?WSDL http://localhost/MES_Srv/RAS_Equipment.asmx?WSDL

如果要将这条命令集成到IDE的自动生成中,可以在菜单->项目->属性->生成事件中,预生成事件命令行中填入:

$(ProjectDir)generateProxy.bat /out:$(ProjectDir)MES_WebService.cs

generateProxy.bat中内容如下:

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\wsdl.exe" /nologo /language:cs /sharetypes %1 /namespace:TRG_MES.MES_WebService http://localhost/MES_Srv/WIP_Workflow.asmx?WSDL http://localhost/MES_Srv/WIP_Transaction.asmx?WSDL http://localhost/MES_Srv/SYS_SiteInfo.asmx?WSDL http://localhost/MES_Srv/RAS_Equipment.asmx?WSDL