【问题标题】:Getting WSDL from VS2010 WCF Service application从 VS2010 WCF 服务应用程序获取 WSDL
【发布时间】:2012-08-07 06:35:53
【问题描述】:

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

代码

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

【问题讨论】:

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


    【解决方案1】:

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

    您也可以为此使用 SVCUtil。

    【讨论】:

      【解决方案2】:

      尝试将?wsdl 添加到服务网址的末尾。

      【讨论】:

        【解决方案3】:

        如果您需要将 WSDL 导出到文件,您可以使用 SVCUtil 来完成。

        svcutil /t:metadata http://servername/path/WCFSeviceApplication.svc?singleWsdl
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-03-28
          • 2013-09-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多