WCF: how to generate a single WSDL document, without WSDL:import?

前端 未结 6 1283
既然无缘
既然无缘 2020-12-08 05:25

I\'m troubling into an issue... I\'m trying to find a way to generate a single wsdl document from my WCF service, i.e. without any link to external documents. I\'ve used Fla

6条回答
  •  长情又很酷
    2020-12-08 06:05

    In addition to Jim's answer above, if you're using C# code to configure a WCF ServiceHost directly:

    using System.ServiceModel.Configuration;
    

    and when setting up your ServiceHost:

    UseRequestHeadersForMetadataAddressBehavior urh = new UseRequestHeadersForMetadataAddressBehavior();
    serviceHost.Description.Behaviors.Add(urh);
    

    I struggled to find this information online, as simple as it is. Hopefully helps someone in a similar situation.

提交回复
热议问题