If my contract looks as follows:
[OperationContract]
void DoSomething(int id, out string moreInfo);
this ends up looking like:
string DoSomething(int id);
when you import a web service reference. Is it possible to influence the auto-conversion of the order of the parameters? It was already surprising to find all out-parameters at the beginning of the function signature, but that was still workable, but we'd like void-methods to continue being void-methods. Or is this a SOAP limitation?
It appears to be based on a WSDL limitation: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/48b5992f-f7bd-4b67-8299-514d1780fa9a
WSDL does not show the original method signature; instead, it shows the input parameters as a group and the output parameters as another group.
The limitation of not being able to separate return values from out parameters is in the WSDL. But that would mean the limitation of a void method would be part of svcutil.exe I think. There's no reason why there can't be a switch on svcutil to not move the first output to a return value, but that would be a request for a feature on ms connect.
Rather than void, you could return a simple status int or bool if your issue is consistency, but I'm sure that's not a perfect answer if you already have dozens of methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With