我刚刚在 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;
}
}
引用文献
最佳答案
您可以右键单击 svc 文件并选择在浏览器选项中查看。然后,将 ?WSDL 添加到 URL 的末尾。它将显示 WSDL 文件。
您也可以为此使用 SVCUtil。
关于c# - 从 VS2010 WCF 服务应用程序获取 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11840516/