获取WSDL从VS2010 WCF服务应用程序 [英] Getting WSDL from VS2010 WCF Service application

查看:203
本文介绍了获取WSDL从VS2010 WCF服务应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建在Visual Studio 2010年。它具有以下配置和服务code样本WCF服务应用程序。我需要看到生成相应的WSDL。我需要做的,看到相应的WSDL?

code

 公共类服务1:IService1
{
    公共字符串的GetData(int值)
    {
        返回的String.Format(您输入:{0},值);
    }

    公众的CompositeType GetDataUsingDataContract(CompositeType的复合材料)
    {
        如果(复合== NULL)
        {
            抛出新ArgumentNullException(复合);
        }
        如果(composite.BoolValue)
        {
            composite.StringValue + =后缀;
        }
        返回复合材料;
    }
}
 

参考

  1. <一个href="http://stackoverflow.com/questions/9128672/how-to-generate-a-wsdl-file-of-a-wcf-service-library-project?rq=1">How生成一个WCF服务库项目的WSDL文件?
  2. <一个href="http://stackoverflow.com/questions/4178350/is-there-any-way-i-can-create-a-wsdl-file-from-wcf-service-application?rq=1">Is有什么办法可以创建WCF服务应用程序WSDL文件?
  3. WSDL通过WCF
  4. 自动生成
解决方案

您可以右键点击SVC文件,并在浏览器选项选择视图。然后,添加WSDL?到URL的末尾。这将显示WSDL文件。

您还可以使用SvcUtil工具的这一点。

I Just created a sample WCF Service application in Visual Studio 2010. It has the following configuration and service code. I need to see the corresponding WSDL generated. What I need to do to see the corresponding WSDL?

CODE

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;
    }
}

REFERENCES

  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

解决方案

You can right click on svc file and select view in browser option. Then, add ?WSDL to the end of URL. It would show the WSDL file.

You can also make use of SVCUtil for this.

这篇关于获取WSDL从VS2010 WCF服务应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆