![]() |
Languages »
XML »
Web Services
Intermediate
WSS Web Service DISCO and WSDL Generator HelperBy Casey RaybackThe application attached to the article automates the process of generation of *wsdl.aspx and *disco.aspx files needed when developing Web Services for Windows SharePoint Services products. |
C#, XML, Windows, .NET 1.1VS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
If any of you have written Web Services for the Windows SharePoint Services then you know how tedious (and actually boring and annoying) it is to generate the WSDL and disco files using the disco command and then make string replacements to produce new *wsdl.aspx and *disco.aspx files. Since the development is generally done not on the server where WSS (or SharePoint Portal Server) resides, it is even worse to upload the DLLs and definition files to the server and find out that you have made a syntactic error (there's no compiler to tell you that you are wrong, unfortunately). Then you have to do it all once again. Same thing happens when you add a method to the web service, you have to reflect the changes made in the asmx file to the disco and WSDL files, then generate *wsdl.aspx and *disco.aspx again and again.
Our team has written a very simple and very straightforward application that takes the URL of the web service as the argument and it produces those *wsdl.aspx and *disco.aspx files, making all necessary replacements for you. It's a very simple code, but it's very useful especially if you write or modify many web services for WSS.
This article is for the developers who are developing custom web services for Windows SharePoint Services (equally SharePoint Portal Server).
The WSSWebServicePackager.exe uses disco.exe (also provided here) to generate first the disco and WSDL files of the web service. Then the standard string replacements are made (described in MSDN documents) to make the file recognizable by WSS.
The code below starts disco.exe and generates the files. It generates the files into Temp directory. If the directory doesn't exist, it firstly creates it.
//start disco utility to generate the wsdl and disco files
ProcessStartInfo psi = new ProcessStartInfo();
psi.WorkingDirectory = strPathToTempFolder;
psi.FileName = Application.StartupPath + "\\disco.exe";
psi.Arguments = txtURLAsmx.Text;
Process p = Process.Start(psi);
//wait for process to finish
while (!p.HasExited) { }
Then the string replacements in both files are carried. The replacements are described in detail in the MSDN documentation (Writing Custom Web Services for SharePoint Products and Technologies).
The newly generated files are then copied to the folder chosen and are ready to be copied to the ISAPI directory (refer to the MSDN article above).
Hope it helps.
Before we developed this small application, which actually does only the string replacements, it was a very annoying task to make those string replacements by hand after finishing writing the actual code. Now life is a little easier, hope it helps you all :)
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 19 Jun 2005 Editor: Smitha Vijayan |
Copyright 2005 by Casey Rayback Everything else Copyright © CodeProject, 1999-2009 Web11 | Advertise on the Code Project |