c# - 从 VS2010 WCF 服务应用程序获取 WSDL

标签 c# .net visual-studio-2010 wcf wsdl

我刚刚在 Visual Studio 2010 中创建了一个示例 WCF 服务应用程序。它具有以下配置和服务代码。我需要查看生成的相应 WSDL。我需要做什么才能看到相应的 WSDL?

enter image description here

代码

public class Service1 : IService1
{
    public string GetData(int value)
    {
        return string.Format("You entered: {0}", value);
    }

    public CompositeType GetDataUsingDataContract(CompositeType composite)
    {
        if (composite == null)
        {
            throw new ArgumentNullException("composite");
        }
        if (composite.BoolValue)
        {
            composite.StringValue += "Suffix";
        }
        return composite;
    }
}

引用文献

  1. How to generate a wsdl file of a wcf service library project?
  2. Is there any way I can create a WSDL file from WCF Service Application?
  3. WSDL automatically generated by WCF

最佳答案

您可以右键单击 svc 文件并选择在浏览器选项中查看。然后,将 ?WSDL 添加到 URL 的末尾。它将显示 WSDL 文件。

您也可以为此使用 SVCUtil。

关于c# - 从 VS2010 WCF 服务应用程序获取 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11840516/

相关文章:

c# - 如何在 C# 中声明枚举列表<>

c# - 从 SQL Server dbmail 创建/生成 '.eml' 文件

c# - Visual C# 2010 Express : Opening a design and designer tab for a new form in the application

c# - 检查返回值而不将其分配给变量

visual-studio-2010 - VC++ DLL - 防止逆向工程和试用期到期

c# - 在 ASP.NET 4 Web 应用程序中支持多种身份验证策略

c# - ASP.NET MVC 5 模型绑定(bind)不起作用

c# - TcpClient 收到数据时的事件

.net - 从 Internet Explorer 访问硬件

c# - 有没有办法使用 linq 遍历对象列表的属性?