WSE2 and WSDL

I may be at Strategic Architect Forum, but I’ve actually been coding off and on today - using WSE2 to expose web services. I hadn’t realized that SoapService supports auto generation of WSDL – pretty cool. I dug around with Reflector to figure out how it works. Turns out that SoapReceiver (parent of SoapService) exposes a method called GetDescription that returns the WSDL as an XmlDocument. The SoapReceiver version of GetDescription returns null, but the SoapService implementation uses an internal class called WsdlCreator to generate construct a ServiceDescription from SoapService type that you write. Pretty cool.

The only downside is that if you use raw SoapEnvelopes as the input and output parameter of the SoapService methods, the WsdlCreator has no way to know what schema to use for the corrisponding SOAP messages. So, it punts and represents a SoapEnvelope as sequence of xsd:any tags. 😦 If you use XML serializable types for parameters, then the WsdlCreator generates the associated schema in the WSDL. Only issue, I gave up on XML serialization a while ago.

I wish there was a way to adorn the SoapService methods with an attribute indicating the associated message schemas (with the ability to validate those messages automatically).

Comments:

Did you ever find a suitable way of doing this? I have a web service that has types that are very ugly to work with when xsd.exe'd, not to mention that it takes xsd.exe eons to generate millions of lines of really bad code for the huge schemas I am trying to work with. My service works just fine without WSDL, but I would really like to have dressed up in an actual-factual WSDL document when it is exposed in the wild. I am starting to think my best bet is to override GetDescription and return a hand made WSDL. Any thoughts?