Data Contract to XSD

Apr 9, 2008 at 3:02 AM
Edited Apr 9, 2008 at 3:43 AM

Hi All,

I am currently using the Web Service Software Factory on my project and am wondering if you can generate an XSD file off a data contract?

I know you can create a data contract using the modelling tool and from that generate the appropriate classes. But it would be good if you could generate the classes as well as the schema for the data contract.

I want to use the schema to validate details in the request message contract.

Do you know if this is possible?

Apr 9, 2008 at 3:23 PM
Hi Jo,
You have two options to do this:
  1. Genareate de classes and from there create the xsd using the svcutil.exe tool specifying the asm file that contains your DC generated types.
  2. Add a recipe to the WSSF package source code that generate the XSD along with the classes in one operation.
The first option is straightfoward and you don't need to update anything. The second option makes sense if you plan to do this on a daily basis and along your company so updating the package with help of the 'Extensibility Hands-on labs' may be possible.
I suggest try #1 first and see if that fits your needs and if required, then consider #2.
Apr 9, 2008 at 11:56 PM
Thanks charlyfriend!

Tested the first option and it can definitely be done.

Just have to modify the guidance packages to get it working while generating the code.