Purpose of WSDL generator

Mar 8, 2010 at 4:23 PM

Since WCF automatically provides WSDL with ?wsdl on the URL, what is the advantage of generating WSDL with WSCF.blue?

(The home page says "A WSDL Wizard that allows the developer to step through the creation of a WSDL from one or more XSDs.".  I'm wondering what is the benefit?).

Thanks,
Neal Walters

 

Developer
Mar 9, 2010 at 11:47 AM

Hi Neal,

The article I pointed out in the reply to your other post will explain the purpose of creating the WSDL upfront in much more detail than I could explain here.

Cheers,

Alex.

Mar 9, 2010 at 12:48 PM

Hi Neal,

Appending ?wsdl to an endpoint assumes that the service exists!! one of WSCF's main purposes is to allow you to build that service when all you have is a bunch of schemas. And creating WSDLs manually is error prone, hence the wizard. (Its analogous to BizTalk where we can publish schemas as a webservice but here we can then take it a step further and generate the service interface as well)

By keeping the schemas outside the WSDL, your main WSDL is also much smaller and much more maintenance friendly because  a majority of the time, the changes are to the schemas and rarely to the WSDL itself.  I have found that it also promotes some good design in schemas because I now keep my message contracts separate from my datacontracts (as in, separate XSD files. This may not work for everyone but I use this approach wherever possible).

You could think of WSCF as "svcutil on steroids" :-) svcutil doesnt let you build the service interface, nor does it let you generate contracts into multiple files or choose the style (arrays, collections etc) . However, underneath the covers we do use the ServiceContractGenerator which is what svcutil uses too. I will be starting a post series shortly on the internals of WSCF and talk about the SCG amongst others.

The second thing is that, when writing a client too, one of WSCF's principles is that the auto-reflection provided by ?wsdl doesnt always give the cleanest representation of the metadata, so when you have access to the contract (wsdl and xsd) especially when you control both sides, then it would be better to reuse that contract and generate the client. This is the approach taken in the walkthrough document that i put in my reply to your earlier post. Of course, we dont always have the WSDL locally so it is good to be able to generate a client just by pointing at an existing WSDL endpoint.  (I need to get back to you on this but i dont think we can generate clients automatically yet for multi-part WSDLs. I have started writing some code for this recently).

Hope this helps. Please do continue to send us feedback and questions and any suggestions for functionality that would be useful to your projects.

Regards,

Benjy