创建TRESTClient时出错:“没有注册带有guid [{}]的接口的对等体
发布时间:2020-12-15 09:07:29 所属栏目:大数据 来源:网络整理
导读:我已经创建了我的类来使用REST.我在运行时遇到TRESTClient组件的问题. TFrwWebServiceREST = class(TInterfacedObject,IRESTWebServiceProxy)private FClientRest: TRESTClient; FRequestRest: TRESTRequest; FResponseRest: TRESTResponse;public construct
我已经创建了我的类来使用REST.我在运行时遇到TRESTClient组件的问题.
TFrwWebServiceREST = class(TInterfacedObject,IRESTWebServiceProxy) private FClientRest: TRESTClient; FRequestRest: TRESTRequest; FResponseRest: TRESTResponse; public constructor Create (AUrl: string); virtual; end; ... constructor TFrwWebServiceREST.Create(AUrl: string); begin FClientRest := TRESTClient.Create (AUrl); //the error occurs here FClientRest.AcceptEncoding := 'UTF-8'; FResponseRest := TRESTResponse.Create (nil); FResponseRest.ContentEncoding := 'UTF-8'; FRequestRest := TRESTRequest.Create (nil); FRequestRest.AcceptEncoding := 'UTF-8'; FRequestRest.Response := FResponseRest; FRequestRest.Client := FClientRest; end; 错误并不总是发生…该过程完美地运行,然后一段时间后,此错误开始发生.
创建RESTClient时会引发异常.它能是什么? 解决方法
有必要将IPPeerClient包含在客户端代码中的“uses”子句中,并将IPPeerServer包含在服务器代码中的“uses”子句中,请参阅
http://blogs.embarcadero.com/pawelglowacki/2013/01/10/39958 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |