ServiceModel Metadata Utility Tool (Svcutil.exe)
https://msdn.microsoft.com/en-us/library/aa347733.aspx
The ServiceModel Metadata Utility tool is used to generate service model code from metadata documents and metadata documents from service model code.
SvcUtil.exe
The ServiceModel Metadata Utility Tool can be found at the Windows SDK installation location, specifically, C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin
Functionalities
The following table summarizes the various functionalities provided by this tool and the corresponding topic that discusses how it is used.
Timeout
The tool has a 5 minute timeout when retrieving metadata.
This timeout only applies to retrieving metadata over the network.
It does not apply to any processing of that metadata.
Multi-targetting
The tool does not support multi-targeting.
If you want to generate a .NET 4 artifact from svcutil.exe, you have to use the svcutil.exe from the .NET 4 SDK.
To generate a .NET 3.5 artifact, use the executable from the .NET 3.5 SDK.
Accessing WSDL Documents
When you use Svcutil to access a WSDL document that has a reference to a security token service (STS), Svcutil makes a WS-MetadataExchange call to the STS.
However, the service can expose its WSDL documents using either WS-MetadataExchange or HTTP GET.
Therefore, if the STS has only exposed the WSDL document using HTTP GET, a client written in WinFX will fail.
For clients written in .NET Framework 3.5, Svcutil will attempt to use both WS-MetadataExchange and HTTP GET to obtain the STS WSDL.
Using SvcUtil.exe
Common Usages
The following table shows some commonly used options for this tool.
参数:
/directory:<directory>
描述:
Directory to create files in. Default: The current directory.
Short form: /d 缩写
Metadata Export
Service Validation
Metadata Download
XmlSerializer Type Generation
Examples
Maximum Nametable Character Count Quota
Security Concerns
How to: Use Svcutil.exe to Download Metadata Documents
To download metadata using Svcutil.exe
-
Locate the Svcutil.exe tool at the following location:
C:\Program Files\Microsoft SDKs\Windows\v1.0. \bin
-
At the command prompt, launch the tool using the following format.
svcutil.exe /t:metadata <url>* | <epr>
You must specify the /t:metadata option to download metadata. Otherwise, client code and configuration are generated.
-
The <url> argument specifies the URL to a service endpoint that provides metadata or to a metadata document hosted online. The <epr> argument specifies the path to an XML file that contains a WS-Addressing EndpointAddress for a service endpoint that supports WS-MetadataExchange.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了