首先谢谢ycluo和shangshang同学<br><br>InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap), ioDocument);<br>这句代码我是查的大富翁加上的,但是没有用。所以才发的帖子提问。主要是用<br>dldata这个接口时就报错了。<br>下面是我的代码<br>unit UnitIExchangeData;<br><br>interface<br><br>uses InvokeRegistry, SOAPHTTPClient,usoapmain, Types, XSBuiltIns;<br><br>type<br><br> IExchangeData = interface(IInvokable)<br> ['{D3EC2EED-70F0-B447-AA38-2326B6097827}']<br> function DLData(const DataName: string; var DataContent: String; const Password: String; const Kddm: String; const TestDate: String): Integer; stdcall;<br> function UPData(const DataName: WideString; const DataContent: string; const Password: String; const Bz: String): String; stdcall;<br> end;<br><br>function GetIExchangeData(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IExchangeData;<br><br><br>implementation<br><br>function GetIExchangeData(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IExchangeData;<br>const<br> defSvc = 'IExchangeDataservice';<br> defPrt = 'IExchangeDataPort';<br>var<br> RIO: THTTPRIO;<br> defWSDL: string;<br> defURL: string;<br>begin<br> Result := nil;<br> defWSDL := gWSDLFile;<br> defURL := gWebSvrURL; <br> if (Addr = '') then<br> begin<br> if UseWSDL then<br> Addr := defWSDL<br> else<br> Addr := defURL;<br> end;<br> if HTTPRIO = nil then<br> RIO := THTTPRIO.Create(nil)<br> else<br> RIO := HTTPRIO;<br> try<br> Result := (RIO as IExchangeData);<br> if UseWSDL then<br> begin<br> RIO.WSDLLocation := Addr;<br> RIO.Service := defSvc;<br> RIO.Port := defPrt;<br> end else<br> RIO.URL := Addr;<br> finally<br> if (Result = nil) and (HTTPRIO = nil) then<br> RIO.Free;<br> end;<br>end;<br><br><br>initialization<br> InvRegistry.RegisterInterface(TypeInfo(IExchangeData), 'urn:ExchangeDataIntf-IExchangeData', 'utf-8');<br> //InvRegistry.RegisterInvokableClass(ServiceSoapImpl);<br> InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IExchangeData), 'urn:ExchangeDataIntf-IExchangeData#%operationName%');<br> InvRegistry.RegisterInvokeOptions(TypeInfo(IExchangeData), ioDocument);//就是这一行<br><br><br>end.