Getting WSDL from VS2010 WCF Service application

╄→гoц情女王★ 提交于 2021-02-07 08:57:16

问题


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?

enter image description here

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

回答1:


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.




回答2:


Try to add ?wsdl to the end of your service url.




回答3:


If you need to export the WSDL to a file you can use SVCUtil to accomplish this.

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


来源:https://stackoverflow.com/questions/11840516/getting-wsdl-from-vs2010-wcf-service-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!