Reputation: 4053
I have WSDL file and XSD files and need to programmatically create WCF service.
Programmatically means without using any utility tool such as SvcUtil.exe.
What's my problem here..??
I haven't found anything like that on internet.
I know how to create WCF service using ChannelFactory, but I don't know how to employ existing WSDL file in such a scenario.
There's something about using IXmlSerializable interface and its GetSchema, ReadXml and WriteXml methods, but I'm not sure how to use it.
Thank you in advance.
Goran
Upvotes: 0
Views: 1091
Reputation: 6541
SvcUtil.exe doesn't do anything "magical" that you can't do yourself in your own code; It uses public WCF classes to process WSDL and XSD, you can use the exact same classes (for example, System.ServiceModel.Description.WsdlImporter), but unfortunately it's not very easy. Read http://msdn.microsoft.com/en-us/library/ms731768.aspx and its subtopics as a starting point. You can also open up SvcUtil.exe itself in Reflector to look at its code and see how it does certain things. I think there are also some open-source implementations of a "better svcutil", you can look at their code as well, unfortunately I can't remember any details at the moment.
Upvotes: 1