2016-10-22 44 views
0

我使用Delphi编写独立SOAP服务器。它包含服务器的函数返回的版本,例如:Delphi SOAP服务器更改输出参数名称

function TMySOAP.GetVersion: string; stdcall; 
begin 
    Result := '1.0'; 
end; 

根据某些规范函数的输出值应该有名字“结果”,所以WSDL应该是这样的:

<message name="GetVersion3Response"> 
    <part name="Result" type="xs:string"/> 
</message> 

但由于Delphi使用标识符“结果”在它自己的目的,我的服务器生成WSDL旁边:

<message name="GetVersion3Response"> 
    <part name="return" type="xs:string"/> 
</message> 

输出参数的名称在specificati是硬编码由于名称不匹配,客户端程序无法正确处理我的服务器的答案。

有没有办法将输出参数的名称改为'Result'?

回答

1

查找答案由我自己:

procedure TMySOAP.GetVersion(out Result: string); stdcall; 
begin 
    Result := '1.0'; 
end; 

似乎它的工作原理。

+0

事实上,DLL永远不应该在其边界上传递一个“字符串”,特别是不能作为函数结果。 –