我已经创建了我的类来使用REST.我在运行时遇到TRESTClient组件的问题. TFrwWebServiceREST = class(TInterfacedObject, IRESTWebServiceProxy)private FClientRest: TRESTClient; FRequestRest: TRESTRequest; FResponseRest: TRESTR
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;
错误并不总是发生…该过程完美地运行,然后一段时间后,此错误开始发生.
First chance exception at $7656C54F. Exception class EIPAbstractError with message ‘No peer with the interface with guid {B8BD5BD8-C39D-4DF1-BB14-625FC86029DB} has been registered’.
创建RESTClient时会引发异常.它能是什么?
有必要将IPPeerClient包含在客户端代码中的“uses”子句中,并将IPPeerServer包含在服务器代码中的“uses”子句中,请参阅http://blogs.embarcadero.com/pawelglowacki/2013/01/10/39958
