请问有人能解释一下这个行为吗?看起来Delphi SOAP将函数结果设置为最后一个参数,但WSDL.exe读取第一个参数作为函数结果。
我在Delphi SOAP服务中有以下方法,其中结果字符串用于基本错误处理:
function LoadCustomer(CustomerID: Double; out CustomerName: String): String;
生成的WSDL如下所示:
<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>
由于某种原因,WSDL.exe生成了以下C#代码,其中交换了CustomerName和'Result'字符串:
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;
}