0

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

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

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

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

4

1 回答 1

0

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

“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
于 2013-09-11T21:15:47.270 回答