Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVCUtil or WSDL batch processing

I was given a set of 170 WSDL files which I need to convert to C# class files. Is there any way to batch process this?

like image 484
Hungry Beast Avatar asked Sep 21 '09 19:09

Hungry Beast


1 Answers

If you have all of them in a directory, you should probably run something like this:

$wsdls = gci | ? { $_.Name -like "*.wsdl" } | % { $_.Name }

Foreach ($wsdl in $wsdls) {
  & "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\svcutil.exe" '$wsdl' /n:*,Your.Desired.Net.Namespace /o:'$wsdl'.cs /noconfig
}

If there are on subdirectories, you can easilly make this recursive, and if you only have a list of addresses you can put them all in a .txt file, then go trough the content and call svcutil on each line.

The important part is probably how to manage the namespace of the generated code, and how to name all these files.

like image 159
Philippe Avatar answered Oct 14 '22 21:10

Philippe