wcf service - edit wsdl file  
Author Message
liorhg





PostPosted: Windows Communication Foundation ("Indigo"), wcf service - edit wsdl file Top

Hi,

Do you know how can I add an xml schema to the wsdl file describing the service contract that is exposed to the client

thanks.



Visual Studio 20089  
 
 
Ed Pinto - MSFT





PostPosted: Windows Communication Foundation ("Indigo"), wcf service - edit wsdl file Top

Hi,

You have a few options. 1) add a type to your service contract that projects the schema you want. If you just want explicit control of the schema make your type IXmlSerializable and implement GetSchema. If this is not the answer you are looking for, 2) create your own wsdl with your additional schema and point to it using the ServiceMedataBehavior.ExternalMetadataLocation. Finally, if you would prefer not to manually maintain your wsdl and retain the benefits of wsdl generation while dynamically adding your schema to the generated wsdl you can implement IWsdlExporterExtension. Here is a sample for that last option: http://msdn2.microsoft.com/en-us/library/aa717040.aspx. The sample adds comments to the wsdl, not schemas, but it demonstrates the mechanics of the exporter.

Cheers,

Ed


 
 
liorhg





PostPosted: Windows Communication Foundation ("Indigo"), wcf service - edit wsdl file Top

Thank you!
 
 
liorhg





PostPosted: Windows Communication Foundation ("Indigo"), wcf service - edit wsdl file Top

Hi,

I was looking at the option of implementing The IXmlSerializable interface and I saw a couple of places which stated that this interface is not intended for public use, and might not be supported in future versions... Is it safe to use that interface after all

Thank you,

Lior