Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, October 18, 2012 9:17 AM
Hi,
We have a project that has 2 requirements:
1) Create WSDL from XSD files. XSD files are input. The service contract is known as well and it's fixed. Everything should be done programmatically, through the code.
2) Create WCF service from WSDL. Everything should be done programmatically, through the code.
Thank you in advance.
Goran
All replies (3)
Friday, October 19, 2012 8:22 AM ✅Answered
Hi ,
For Q1:I don’t think you can create WSDL from XSD, see the discussion here: http://stackoverflow.com/questions/920086/generating-a-wsdl-from-a-xsd-file
For Q2: Why do you want to create WCF service from WSDL by code? I think using svcutil will be easier.
Please check-out this link: http://stackoverflow.com/questions/950150/how-to-use-a-wsdl-file-to-create-a-wcf-service-not-make-a-call
By the way, I google for questions 2 ,wishing to find the code but no luck. If you really want to achieve this programmatically, try to do by yourself. Good luck!
Cheers, Amy
Friday, October 19, 2012 11:15 AM ✅Answered
1. XSD is to define the structure of a xml file, while WSDL is a xml file with some set of rules say header, wrapper etc. So basically you are trying to create a xml file from a XSD.
2. check this link http://social.msdn.microsoft.com/forums/en-US/wcf/thread/fc2c5074-1116-4f92-a972-01bb3a142535
regards
joon
Friday, October 19, 2012 10:58 AM
You can use svcutil to create the wsdl proxy file and then use it in your code.
You can automate creating wsdl proxy file by overriding your MSBuild step and using task to call svcutil tool and then creating the proxy file.
Mark it as helpful if so! Thanks