What is the best way to download all of the WSDL files exposed by a WCF service?

前端 未结 4 906
时光取名叫无心
时光取名叫无心 2020-12-31 02:00

What is the best way to download all of the WSDL files exposed by a WCF service?

For example, the root WSDL file references the following other WSDL files:



        
相关标签:
4条回答
  • 2020-12-31 02:28

    There is a simple code snippet that makes it possible downloading a WSDL and all the belonging XSD files for offline use (for example for code generation).

    Update

    The blog where the code snippet was shown is not available anymore. Luckily, Pablo Diez created a small project based on my blog post and uploaded it to github. It is available now here: https://github.com/pablod/xsd-downloader

    0 讨论(0)
  • 2020-12-31 02:34

    It looks like Microsoft provide Disco.exe for doing this.

    0 讨论(0)
  • 2020-12-31 02:35

    Meanwhile, disco.exe is considered obsolete technology by Microsoft.

    You can use svcutil.exe /t:metadata to achieve the same in the WCF age. Additional benefits are support for additional features, eg WS-Policy.

    Save schema from URL:

    svcutil /t:metadata http://host/pathtomy.svc?wsdl

    Save schema from assembly, eg in automated build:

    svcutil /t:metadata c:\wcfweb\pathToWcfServiceAssembly.dll

    0 讨论(0)
  • 2020-12-31 02:52

    If you own the service, another interesting option you could explore is using Christian Weyer's FlatWSDL behavior, which will force WCF to generate everything in a single WSDL document, which should make it a lot easier for you to distribute it.

    0 讨论(0)
提交回复
热议问题