Create Custom SharePoint Web Service WSDL and Disco ASPX Files Automatically

I just completed a SharePoint developer tool called SPDev.exe. The initial purpose of this utility is to auto-generate the web service WSDL.aspx and Disco.aspx files needed for a custom SharePoint web service.

icon_shout Automatically generate your SharePoint disco.aspx and wsdl.aspx files in seconds!
icon_shout No need to manually copy or deploy your .asmx first!
icon_shout No manual editing!
icon_shout No Disco.exe needed!
icon_shout Automatically recycles the application pool (ensuring the newest assembly is loaded)!
icon_shout Automatically deploys the final SharePoint web service files (using the -deploy option)!
icon_shout No UI to enter data each time.  A command tool you can script for fast, consistent re-use!

After having to manually modify the disco.aspx and wsdl.aspx files by hand for the last three years, I finally found it tedious enough to create this utility.  There are other tools out there, but they require you to enter information into a Windows UI, they are not script-able, and still felt to tedious for me.  Call me lazy.  :)  Time is money.  This tool is a command line utility.  Simply execute the SPDev.exe command and your MyServiceDisco.aspx and MyServiceWsdl.aspx files are immediately ready for deployment.  SPDev also allows you to script the process.  Create a .cmd or .bat file and you’ll never have to enter any parameters again.  Another big benefit is you don’t need to use the Disco.exe utility since SPDev uses IIS and .NET instead which will always be on your development machine – since you are developing for SharePoint.  And, there are no temp files are generated (unless you want them generated).

Documentation for this utility is on my blog here:

2 thoughts on “Create Custom SharePoint Web Service WSDL and Disco ASPX Files Automatically

  1. (Migrated Comments from my old blog)

    I just downloaded this and it did not work

    The disco appears to generate fine, but the wsdl does not, instead I get an html output page with the word ‘Error’ hardcoded into it.
    at 4/28/2009 2:52 PM
    Re: I just downloaded this and it did not work Edit

    Thanks for your feedback. I’m not sure what the cause of the error was for your specific situation, but I have added the -debug option to display more error information. I did make a change to remove the read-only flag on any previously copied -asmx file so that it will properly delete. Hopefully this will resolve the problem you encountered, If not, please use -debug parameter to display more error information, and provide that information in another feedback.

    Also, I have added a couple new parameter optons, changed (shortened) the SPDev.exe command name, corrected some possible errors, and have also changed some parameter names and the command syntax. So please review the command help to ensure you are using correct command syntax. See the Updates section in the article for the details.

    And, thanks again for your feedback.
    Mark Wagner at 5/3/2009 8:01 PM
    Love it!

    This worked awesome! thanks. The command ran and was done in about 3 seconds!
    at 5/4/2009 4:40 PM

    I Have try it. Thank for the tools, It make life more simple.

    at 5/6/2009 9:57 AM
    Web Service disco is not a valid Disco File

    I ran this on my webservice asmx file and it did the recycleing, then generated the disco and wsdl file , then gave a message that the disco file is not a valid dico file.

    at 5/6/2009 10:56 AM
    Re: Web Service disco is not a valid Disco File

    Use the -tempfiles parameter option to save the generated .disco and .wsdl files to a subfolder named Temp. After running the command, look in the temp subfolder and see what the .disco and .wsdl files look like.

    If this does not look like the typical WSDL created for a web service, it may dislay an error indicating what the problem is. If the web service files look fine then use the -debug option.

    If this is still a problem, add the -debug option to your parameters to display the exception stack details and post them back here.
    Mark Wagner at 5/6/2009 1:29 PM
    Re: Web Service disco is not a valid Disco File

    Also, make sure you are compiling and deploying your assembly (to the bin or GAC) before you execute the SPDev command.

    MAKE SURE YOU HAVE THE LATEST VERSION. The SPDev utility was recently updated.
    Mark Wagner at 5/6/2009 2:09 PM
    >wsdl file is not valid

    I was able to fix the invalid .disco file error by using the stong name method you stated earlier in this article.
    When I ran Spdev the .disco file got created without any error messages. However, It created a .wsdl file in the temp folder and
    displayed error “web service .wsdl file is not a valid wsdl file”.
    It appears that the .wsdl file in the temp folder is an xml file and as i search ot i do not see any error embedded in it. Can u give me advise as to why this is happening? thanks. Don.
    I will try and paste the .wsdl file on next post.

    at 5/7/2009 2:18 PM
    Re: wsdl file is not valid

    I just posted a new version with the fix that should resolve your problem. The logic I was using to verify the .disco and .wsdl files was to strict. You’ll need to get the latest download of SPDev.
    Mark Wagner at 5/7/2009 2:48 PM
    disco file not valid

    I also have an invalid disco file. I have made sure it is strongly named etc. I have even recreated the entire project. the details I get with the -debug option are:

    E:\Visual Studio 2008\Projects\FOCService\FOCService>SPDev.exe -o GenWS -url htt
    p://syn00101 -asmx InitWorkFlow.asmx -debug
    SPDev generating SharePoint web service files:
    Copying .asmx file to working folder… done.
    Recycling the application pool ‘SharePoint – 80’… done.
    Generating .disco and .wsdl files…done.
    Web service .disco file is not a valid DISCO file. File InitWorkFlow.disco saved
    in the temp folder.
    at Wagner.SharePoint.Utilities.GenWS.Run()
    at Wagner.SharePoint.Utilities.SPDev.Run()
    at 6/5/2009 4:18 AM
    Re: disco file not valid

    My appologies for the delay. I will address this later today and post an updated executable tonight. I may just remove the fle validation logic as it seems to be causing problems with valid .files.

    If you could post the generated disco file as a comment I can see what my validation is not accounting for. I only need the first 10 lines.
    Mark Wagner at 6/9/2009 7:01 AM
    Very nice site!

    Very nice site!
    at 8/1/2009 6:26 AM
    Very nice site!

    Very nice site!
    at 8/6/2009 10:22 PM
    I get still disco file not valid

    Hi there, first great tool, but i get still the discofile not valid error and only a generated wsdl file in a temp-folder

    Here the first lines of the generated file

    </p> <p>Fehler </p> <p>

    Commandline output:

    Web service .disco file is not a valid DISCO file.
    saved in the temp folder.
    bei Wagner.SharePoint.Utilities.GenWS.Run()
    bei Wagner.SharePoint.Utilities.SPDev.Run()

    Any idea?
    at 8/25/2009 5:11 PM
    Very nice site!

    Very nice site!
    at 9/15/2009 2:33 AM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s