如何在OnBeforeExecuteEvent中将THTTPRio.Converter.Options设置为soLiteralParams [英] How to set THTTPRio.Converter.Options to soLiteralParams in OnBeforeExecuteEvent
问题描述
这是有关帖子 Delphi SOAP信封和WCF 。
有人可以发布一个示例代码,该代码可以向我展示如何在Delphi 7中的THTTPRio.Converter.Options中设置soLiteralParams。
Could someone please post a sample code which can show me how to set soLiteralParams in THTTPRio.Converter.Options in Delphi 7. I have the following code currently.
我已将HTTPRIO组件拖放到文档中,该文档在代码的开头创建了行HTTPRIO1:THTTPRIO。我基本上想了解如何在上述组件中设置soLiteralParams。以下是我尝试执行的代码,这给了我错误。
I have drag-dropped a HTTPRIO component into the document which has created a line HTTPRIO1: THTTPRIO at the beginning of the code. I basically want to understand how I set soLiteralParams in the above component. Following is the code I am trying to execute which is giving me error.
procedure TForm1.CleanUpSOAP(const MethodName: String; var SOAPRequest: WideString);
var RIO: THTTPRIO;
begin
//The following line is giving error
// RIO.Converter.options := [soLiteralParams];
end;
在上面的代码中,我声明了类型为THTTPRIO的变量RIO,但我不确定正确。
In the above code I have declared a variable RIO of the type THTTPRIO, which I am not sure is correct.
推荐答案
我已经破解了。问题是我没有引用包含TSOAPConvertOption枚举的OPconvert.pas文件。我不知道是否将此文件复制到与项目文件相同的文件夹中,并在使用部分中进行引用是正确的方法,但效果很好。
I have cracked this. The issue was that I didn't refer to OPconvert.pas file, which contained the TSOAPConvertOption enumeration. I don't know whether copying this file into the same folder as my project files and referring to this in the "uses" section is the right way, but it worked fine.
这篇关于如何在OnBeforeExecuteEvent中将THTTPRio.Converter.Options设置为soLiteralParams的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!