通过命令行或以编程方式检索并生成 WCF Reference.svcmap

本文关键字:WCF svcmap Reference 检索 方式 命令行 编程 | 更新日期: 2023-09-27 18:30:55

通常当我更新/添加新服务引用时,我只会在Visual Studio的解决方案资源管理器中执行此操作(更新服务引用/添加服务引用),但出于要求,我现在必须使用命令行或以编程方式执行此操作。

我读到这个:http://msdn.microsoft.com/en-us/library/ms729834.aspx

它允许我检索元数据,但它不会像我们在Visual Studio中那样生成Reference.svcmap

有没有工具或库可以做到这一点?

通过命令行或以编程方式检索并生成 WCF Reference.svcmap

使用开发人员命令提示符:

"C:''Program Files (x86)''Microsoft Visual Studio 11.0''Common7''Tools''VsDevCmd.bat"

svcutil http://www.webservicex.net/sendsmsworld.asmx
svcutil /t:metadata http://www.webservicex.net/sendsmsworld.asmx

这将生成:

output.config  
SendSMSWorld.cs  
www.webservicex.net.wsdl  

我不确定svcmap,这似乎是来自Visual Studio的东西

                   -= EXAMPLES =-
 svcutil http://service/metadataEndpoint
    - Generate client code from a running service or online metadata documents.
 svcutil *.wsdl *.xsd /language:C#
    - Generate client code from local metadata documents.
 svcutil /dconly *.xsd /language:VB
    - Generate Data Contract types in VisualBasic from local schema documents.
 svcutil /t:metadata http://service/metadataEndpoint
    - Download metadata documents from running services
 svcutil myAssembly.dll
    - Generate metadata documents for Service Contracts and associated types in
    an assembly
 svcutil myServiceHost.exe /serviceName:myServiceName
    - Generate metadata documents for a service, and all associated Service
    Contracts and data types in an assembly
 svcutil myServiceHost.exe /dconly
    - Generate metadata documents for data types in an assembly
 svcutil /validate /serviceName:myServiceName myServiceHost.exe
    - Verify service hosting
 svcutil /t:xmlserializer myContractLibrary.exe
    - Generate serialization types for XmlSerializer types used by any Service
    Contracts in the assembly