Phil Bolduc

I have 6 separate wsdl files which represent various HL7 v3 interactions. Each of these wsdl files declare the same base HL7 v3 data types. Each wsdl is about 350K in size. I have used Thinktecture's WSCF v0.6 tool to generate a separate class file for each data type (class). I have some minor problems using WSCF, so I was wanting to do the same thing using the standard .NET framework tools, i.e., wsdl.exe or wsewsdl3.exe. Unless I have missed something obvious, I cannot find a way of doing the same thing using wsdl.exe or wsewsdl3.exe.

A couple of notes to assist in your answer:

  • I am not the maintainer of the wsdl, so changing the source wsdl is out of the question
  • There are 348 generated classes (1.5MB of C#) in all of the wsdl files, at least 1/2 of these classes are shared between all of the wsdl files.
  • I need to add some additional constructors, methods and properties to other partial class declarations. I do not want to duplicate this code for each wsdl file. Currently, I have 25 classes that I need to enhance in this way.
  • .NET Framework 2.0
  • Generating each wsdl file will overwrite any existing class file as they are all the same types. For example, HL7 v3 defines a data type II (two 'i's) which represents an identifier. Each wsdl file contains the exact same definition for the complex type II. For each wsdl file, it should generate a file II.cs which regardless of the wsdl, the generated file will be identical.

Is there a way to use the standard .NET framework tools to generate individual class files for each type defined in them

Thanks,

Phil Bolduc



Re: ASMX Web Services and XML Serialization Generating proxy classes to individual files?

Phil Bolduc

Although not exactly what I asked for, the net result is the same... there is an option /sharedTypes which will generate all of my wsdl files into one large proxy file with (as the option implies) shared types. See http://www.theserverside.net/tt/blogs/showblog.tss id=WSStrikesBackP6 for example.



Re: ASMX Web Services and XML Serialization Generating proxy classes to individual files?

Phil Bolduc

Unfortunately this does not appear to work with wsdl files. The error I get is:

Error: The /sharetypes switch cannot be used with a WSDL contract or an XSD schema, please use collection of urls and .discomap documents.

Alas, back to square one. Guess I could do a big work around by creating web services based my initially generated source and then use wsdl.exe /sharetypes using a faked out web service. This seams a bit convoluted. Guess I will stick with Web Services Contract First (wscf) for now.

Ideas





Re: ASMX Web Services and XML Serialization Generating proxy classes to individual files?

Phil Bolduc

A coworker of mine pointed out how to get around this problem. The solution is to use file:// urls,

wsdl.exe /sharetypes /out:client.cs file://c:/wsdl_a.wsdl file://c:/wsdl_b.wsdl file://c:/wsdl_c.wsdl

Now the trick is how to correctly get my msbuild script to create the command line correctly.

Phil