简体   繁体   English

WCF代理生成:svcutil.exe vs wsdl.exe

[英]WCF proxy generation: svcutil.exe vs wsdl.exe

I have .wsdl and .xsd files from WebService and need to generate proxy by them. 我有来自WebService的.wsdl和.xsd文件,需要通过它们生成代理。 Svcutil.exe and wsdl.exe generate very different output. Svcutil.exe和wsdl.exe生成非常不同的输出。 What is the difference between these two tools for proxy generation and which way is more preferable? 这两种代理生成工具有什么区别,哪种方式更可取?

Svcutil and wsdl are two different technologies for generating a proxy for consuming your service. Svcutil和wsdl是两种不同的技术,用于生成代理以使用您的服务。 But wsdl.exe was made for old .NET 2.0 web services. 但wsdl.exe是为旧的.NET 2.0 Web服务而制作的。 It is like old version of svcutil. 它就像svcutil的旧版本。 Svcutil allows you to generate proxies for both - web services and WCF services. Svcutil允许您为Web服务和WCF服务生成代理。 For generating a proxy wsdl retieves the data by means of DISCO discovery protocol. 为了生成代理,wsdl通过DISCO发现协议来撤销数据。 Svcutil also supports DISCO. Svcutil还支持DISCO。 But it can make the proxy retrieval using WS-Metadata Exchange protocol, which is an interopable standart of SOA. 但它可以使用WS-Metadata Exchange协议进行代理检索,这是SOA的可互操作标准。

I advice you to use svcutil because it would allow you to consume both .net 2.0 web services and wcf services. 我建议你使用svcutil,因为它允许你使用.net 2.0 web服务和wcf服务。

For what i know today wsdl is useful when you must generate a client code for an old version of the framework. 对于我今天所知,当你必须为旧版本的框架生成客户端代码时,wsdl很有用。 For example when you have a codebase in NET 2.0 and you want call a WCF service. 例如,当您在.NET 2.0中拥有代码库并且希望调用WCF服务时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM