none
Generate WSDL for a .NET web service

    Question

  • I have an urgent requirement to create the WSDL file for Web service.I do not have to make the web service functional, just write the interfaces and create a WSDL.

    Is there any tool for doing this?

    What is the best way to go about it?Any suggestions please.It is urgent.
    • Edited by John SaundersModerator Thursday, November 05, 2009 8:00 PM Not limited to ASMX apparently
    • Moved by John SaundersModerator Thursday, November 05, 2009 8:00 PM WCF Question (From:ASMX Web Services and XML Serialization)
    Thursday, November 05, 2009 5:07 PM

All replies

  • You can use any of the VS templates to create your web service. Then you can modify your interfaces as you want. And then after running the service (even if it does nothing with the implementation of the interfaces) you can see the WSDL of your service.

    Suggestion: you can use WCF to write a Web Service, write its interfaces and access its WSDL very easily.
    Thursday, November 05, 2009 6:27 PM
    Moderator
  • How can i do that? Could you give me any samples, expamles?
    i am new to all this.Any help will be appreciated.
    Thursday, November 05, 2009 6:45 PM
  • The WCF Developer Center is located at http://msdn.microsoft.com/wcf.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Thursday, November 05, 2009 7:59 PM
    Moderator
  • I wanted to understand one small thing.For smx webservice, if we create an xsd, and use the xsd.exe tool it generated the clss which we can use t=in the web service.
    Is there any such utility for generating a class for WCF web services?
    I mean any utility which will generate the class with the

    [System.Runtime.Serialization.

    DataMemberAttribute()] attribute for the corresponding XML?
    Please let me know.Do I need to write the code explicitely for this?

    Thursday, November 05, 2009 9:54 PM
  • You don't need any such tool, since you don't need any such attributes.

    Using WCF, you are much better off not using an XSD. Just create your class, and put [DataContract] on the class. Then, for each property you want to expose, put [DataMember] on the property.

    Now you're finished!

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects
    Thursday, November 05, 2009 11:11 PM
    Moderator
  •  I can follow the way you have mentioned above if I just have a few properties.But in my case I have a complex xml.
    So writing this XML as class will not be possible manually.The class which does get  generated from xsd.exe does not have the DataMeneber attributes and also something like this:

    [System.CodeDom.Compiler.

    GeneratedCodeAttribute("xsd", "2.0.50727.1432")]

    [System.

    SerializableAttribute()]

    [System.Diagnostics.

    DebuggerStepThroughAttribute()]

    [System.ComponentModel.

    DesignerCategoryAttribute("code")]

    [System.Xml.Serialization.

    XmlTypeAttribute(AnonymousType = true)]

    [System.Xml.Serialization.

    XmlRootAttribute(Namespace = "", IsNullable = false)]

    public

     

    partial class NewDataSet2

    {

     

    private object[] itemsField;

     

    //<remarks/>

    [System.Xml.Serialization.

    XmlElementAttribute("ABC", typeof(ABC))]

     

    //[System.Xml.Serialization.XmlElementAttribute("RESERVATIONS", typeof(RESERVATIONS))]

     

    public object[] Items

    {

     

    get

    {

     

    return this.itemsField;

    }

     

    set

    {

     

    this.itemsField = value;

    }

    }

    Thursday, November 05, 2009 11:41 PM