Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schema First WCF Development

Tags:

wsdl

wcf

xsd

It is well-known how to create a "contract first" WCF service where the first step is to define the ServiceContracts and DataContracts.

How should one approach WCF development if one has the "schema first". In other words, an XSD schema has been independently developed. The service may not deviate from the schema that is already defined. As a complication, the schema might use features that don't translate into DataContract (the DataContract capabilities, after all, are quite minimal).

Using XDocument on the server or client side for the entire document would be fine and good. (Use of XDocument would be greatly preferred over anything involving the XmlSerializer which unfortunately seems to have fallen out of favor without replacement). It is a requirement that the metadata/WSDL properly report the actual schema per the standards. It may not report a "generic" schema such as xsd:any. (Figuring out how to deal with these WSDL requirements is the part that is giving me the most trouble.)

(Similar questions/answers here do not address XDocument or WSDL requirements.)

like image 568
Jason Kresowaty Avatar asked Sep 26 '09 15:09

Jason Kresowaty


1 Answers

If you already have the XSD, the only missing link between those and a WCF interface is the WSDL. Once you have a WSDL, you can use svcutil.exe to generate WCF interfaces and classes properly annotated with the required attributes.

You can do it the hard way and write the WSDL by hand, but you also migth want to consider the WSCF tool.

like image 168
Mark Seemann Avatar answered Nov 09 '22 03:11

Mark Seemann