How to generate WSDL files during build time?

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default How to generate WSDL files during build time?

    Hi,

    We have a web serivce in our build system. There are 2 clients for the web
    service. We would like to automatically genrate the wsdl file and the client
    proxies during build time, so that, if the interfaces changed at any time,
    we come to know about it during build time (build would break) rather than
    during run time. I know how to generate the client proxy from the WSDL file
    using WSDL.exe. But how do I generate the WSDL file itself during compile
    time?

    Please help.

    Thanks,
    Prasanna Padmanabhan


    Prasanna Padmanabhan Guest

  2. Similar Questions and Discussions

    1. Slooow Build time
      Flex3 take 10min to build my project, some times 5 just to save a change My environment WinXP 2g ram Flex 3 Eclipse 3.3 The Eclipse CFG...
    2. Using wsdl.exe to generate code
      I create a very simple helloworld webservice using vs.net (let us call it myservice.asmx).I browse to the correspnoding wsdl -...
    3. How To control how WSDL generate schema for nested .NET classes ? (part 2)
      Hi, I've got another issue about how WSDL handles nested classes. consider this type : Public Class CMPXQueryEnvResponse Public Envelope() As...
    4. How To control how WSDL generate schema for nested .NET classes ?
      Hi, is there any attrubute I can place on the web service side to control how nested types are defined in the WSDL ? basically I'd like that such...
    5. Fail to generate proxy .cs file using WSDL tool
      I am hosting remoting object under IIS. When I try to generate proxy *.cs using WSDL.exe tool it fails. (see error message below). I suspect this...
  3. #2

    Default Re: How to generate WSDL files during build time?

    The only way to do this is to run the ASMX through ASP.NET.

    There are 2 approaches. One is to actually deploy the ASMX file into a
    running IIS with ASP.NET installed, then just httpget the URL for thew WSDL,
    eg
    [url]http://yourserver/vroot/Service1.asmx?WSDL[/url]

    To get the WSDL in a build, you can use any command-line httpgetter utility,
    even something as simple as this javascript:

    // getWSDL.js a simple command-line WSDL getter.
    // Call it like this:
    // cscript getwsdl.js <url>
    //
    // output goes to stdout.
    //

    var XMLDoc, XSLDoc ;
    XMLDoc = WScript.CreateObject("MSXML2.DOMDocument") ;
    XMLDoc.async= false;
    XMLDoc.load(WScript.Arguments(0)); // exception here if the ASMX does not
    compile successfully. The result is not XML, it is HTML !!
    WScript.Echo(XMLDoc.xml);
    WScript.Echo("");


    Option 2 is to build a utility to host ASP.NET, and compile the ASMX, and
    produce the WSDL. In this case you wouldn't need IIS, but you'd need to
    build this util yourself. This is attractive, because you do not need to
    deploy to IIS. However, the catch is that since you are not deploying to
    your server, you have to be concerned about the availability of libraries
    that may be referenced by the ASMX.

    Search for articles on "hosting the ASP.NET runtime" to explore this.
    eg,
    [url]http://www.neward.net/ted/Papers/HostingASPNET/HostingASPNET.html[/url]

    Here is an simplistic example console utility that hosts the ASP.NET
    runtime, compiles an ASMX and produces the WSDL on the console.
    [url]http://www.winisp.net/cheeso/srcview.aspx?file=asmx2wsdl.cs[/url]

    Cassini is an example of a pre-built server that hosts ASP.NET (and source
    code is available). Using a server might be more attractive because the
    startup time of an ASP.NET host is significant. A server that runs
    continuously only incurs this cost once (at startup). A command line util
    that hosts ASP.NET must incur the cost with every invocation.

    Using Cassini to produce WSDL from ASMX is very much like using IIS to do
    the same, except, it is not the full IIS. This may be a good thing or a bad
    thing depending on your requirements.

    Find more about cassini on
    [url]http://www.asp.net/Projects/Cassini/Download/Default.aspx?tabindex=0&tabid=1[/url]

    -Dino


    "Prasanna Padmanabhan" <prasannap@citrix.nospam.com> wrote in message
    news:ODiti9oaEHA.1048@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > We have a web serivce in our build system. There are 2 clients for the web
    > service. We would like to automatically genrate the wsdl file and the
    client
    > proxies during build time, so that, if the interfaces changed at any time,
    > we come to know about it during build time (build would break) rather than
    > during run time. I know how to generate the client proxy from the WSDL
    file
    > using WSDL.exe. But how do I generate the WSDL file itself during compile
    > time?
    >
    > Please help.
    >
    > Thanks,
    > Prasanna Padmanabhan
    >
    >

    Dino Chiesa [Microsoft] Guest

  4. #3

    Lightbulb Re: How to generate WSDL files during build time?

    You can use http://wsdlgenerator.codeplex.com, this is a tool to generate a WSDL file from a c# dll which contains one more Microsoft WebServices.
    Stef Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139