Today I was inspecting an existing WSDL created in another framework, and one the response structures didn't quite suit out needs. Specifically, we wanted the response structure to contain discrete schema typed fields to describe the results. The web service team asked if I could send them a quick prototype of a WSDL that would better suit our needs.
I quickly remembered that WEF's Service Definition builder has an input that will build a complete WSDL that contains operations for each of your provider's Service Operations and their input and output structures.
It literally took me 5 minutes to produce a WSDL prototype with Web Experience Factory, which allowed me to quickly send the web service developer an example of what we needed.
Here's what I did:
- Create a provider model
- Add a Variable builder. Call it carsVar. Set the type to XML. Type in XML to represent the structure I want. For example:
<make>Triumph</make> <!-- I really want one of these to restore. Does anyone have one I could have for free? :-) -->
<-- repeat car twice so that WEF's schema generation will create schema with 0 to unbounded car elements -->
- Add a Simple Schema Generator builder, point it at the example variable above. It will create a schema
- Create an Action List builder called getCarsAction. Have it simple return carsVar
- Create a Service Definition builder. Name it CarsSvc. Enable the "Generate WSDL" input. Enable the "Add Testing Support" input (which allows us to get the URL to WSDL)
- Create a Service Operation builder. Name it getCars. Point it to getCarsAction.
- Run it.
The testing support harness will produce a link to the WSDL.
Besides prototyping a possible WSDL for another team, the main use case for having the Service Definition builder generate a WSDL is to turn your provider model into a SOAP-based web service, allowing other applications to leverage your service layer (provider model) that you built with WEF.
I don't know how many customers actually use this feature, but it sure came in handy for prototyping a WSDL.