Could someone please shed some light on this behaviour? It looks like Delphi SOAP sets the function result as the last argument, but WSDL.exe reads the first argument to be the function result.
I have the following method in a Delphi SOAP service, where the result string is used for basic error handling:
function LoadCustomer(CustomerID: Double; out CustomerName: String): String;
The generated WSDL looks like this:
<message name="LoadCustomer2Request">
<part name="CustomerID" type="xs:double"/>
</message>
<message name="LoadCustomer2Response">
<part name="CustomerName" type="xs:string"/>
<part name="return" type="xs:string"/>
</message>
For some reason, WSDL.exe generates the below C# code which swaps the CustomerName and 'Result' strings:
public string LoadCustomer(double CustomerID, out string @return) {
WindowsFormsApplication1.ServiceReference1.LoadCustomerRequest inValue = new WindowsFormsApplication1.ServiceReference1.LoadCustomerRequest();
inValue.CustomerID = CustomerID;
WindowsFormsApplication1.ServiceReference1.LoadCustomerResponse retVal = ((WindowsFormsApplication1.ServiceReference1.ISKiWebInterface)(this)).LoadCustomer(inValue);
@return = retVal.@return;
return retVal.CustomerName;
}