How to create a single WSDL file from existing WCF service?

后端 未结 2 2017
小鲜肉
小鲜肉 2020-12-15 13:17

How do I create a single flat WSDL file (with no external references from within) from an existing WCF service? This WSDL will be used (imported) into an older programming t

2条回答
  •  渐次进展
    2020-12-15 14:00

    I had to do this, too. And I used the WSDLExtras library. It's not too big of a deal.

    Here is a step by step instruction for using it:

    1. Download the WCFExtras from here, extract it and add a reference to it in VS.

    2. Add a reference to your Web.config/App.config like this:

      
          
              
                  
              
          
      
      
    3. Add the extension to your endpoint behavior and set the singleFile attribute to true

      
           
               
           
      
      
    4. Use the endpointbehavior for your service-endpoint.

      
      

    This worked fine for me. You can also download a full example from the WCFExtras project page: ProjectPage

    Edit: For the sake of completeness: You can use the ''?singleWsdl'' query parameter since .NET 4.5 as stated in Irwins answer. See the link he posted for more details.

提交回复
热议问题