I think that the current language bindings for WSDL are broken. Why? Because they distinguish between RPC and non-RPC in the language binding by selecting a programming model based on whether the binding is RPC or not rather than on other principles.
The typical language binding of WSDL seems to be (and please do correct me if I'm wrong) something like this:
- For services with <soap:binding style="rpc">, first map the schema types of the message parts into language types and then generate a stub with each part being an argument.
- For services with <soap:binding style="document">, generate a stub with one or more Element (or some other XML representation) arguments.
- The body of the stub of courses uses some SOAP library to make the actual call.
I think distinguishing between RPC and document styles in choosing the programming model is totally wrong. One can choose to represent RPC style operations with arguments in XML and similarly one can represent document style operations with one mapped types. There is absolutely no requirement to make the arbitrary decision that if the SOAP binding is of document style then the programmer must use an XML style to program and that if the binding is of rpc style then the programmer must use a language types approach. Either of those approaches can be used just fine with either binding! So, which one do you use? IMO its totally up to the programmer - it depends on which style (s)he prefers to code to. If they're operating in an XML environment, it may be natural to continue that style and vice versa. Language bindings today seem to imply that the choice is mandated by WSDL; IMO that's total nosense.
Overall, I think that the distinction between RPC and document is waaaaaay overrated. The only reason the <message> concept exists (and I realize lots of people don't like it ;-)) is to enable one to provide a single programming model for services irrespective of which bindings the service offers. I'll continue this later.
11:16:59 AM
|