E
ecjtuhr
Unregistered / Unconfirmed
GUEST, unregistred user!
一个项目开发环境是delphi 6+ IBMWebsphere+oracle程序在台式机上能运行调试,并且在别人的笔记本上也能调试,可是在我的笔记本上就不行,即使重装系统也是如此,我跟踪了一下,代码如下:[red]mid_server.xmllogic('QuerySQL', EncodingStrReplace(XML_Inparams.XML.Text), ResInf);[/red]到这步后运行调用下面蓝色部分的函数,[blue]function TMidOperator.EncodingStrReplace(Str: WideString): WideString;begin Result := SysUtils.StringReplace(Str, 'encoding="gb2312"', 'encoding="UTF-8"', [rfIgnoreCase,rfReplaceAll])end;[/blue]在返回到这句,result := ResInf.intv; [brown]//正常时应为1[/brown],而我的却是0,之后我找了下ResInf,它是这样定义的:ResInf: resultinf;我又再找了下resultinf,结果在以下单元代码中,unit GAMidAgent;interface{$DEFINE DELPHI6}uses InvokeRegistry, Types, XSBuiltIns;type resultinf = class; { "http://inf.tri.com" } resultinf = class(TRemotable) private FfisrtXML: WideString; Fintv: Integer; Fintvsec: Integer; FsecXML: WideString; published property fisrtXML: WideString read FfisrtXML write FfisrtXML; property intv: Integer read Fintv write Fintv; property intvsec: Integer read Fintvsec write Fintvsec; property secXML: WideString read FsecXML write FsecXML; end; GAMidAgentImpl = interface(IInvokable) ['{DF0D26F5-89C2-A314-7194-6F363E33287F}']{$IFDEF DELPHI6} procedure xmllogic(const opname: WideString; const inParams: WideString; out xmllogicReturn: resultinf); stdcall;{$ELSE} function xmllogic(const opname: string; const inParams: string): resultinf; stdcall; //procedure xmllogic(const opname: String; const inParams: String;out xmllogicReturn:resultinf); stdcall;{$ENDIF} end;function GetGAMidAgentImpl(UseWSDL: Boolean = System.False; Addr: string = ''): GAMidAgentImpl;implementationuses SOAPHTTPClient;function GetGAMidAgentImpl(UseWSDL: Boolean; Addr: string): GAMidAgentImpl;const defWSDL = 'http://localhost:7001/GAMidAgent/services/GAMidAgent?wsdl'; defURL = 'http://localhost:7001/GAMidAgent/services/GAMidAgent'; defSvc = 'GAMidAgentImplService'; defPrt = 'GAMidAgent';var RIO: THTTPRIO;begin Result := nil; if (Addr = '') then begin if UseWSDL then Addr := defWSDL else Addr := defURL; end; RIO := THTTPRIO.Create(nil); //UseWSDL:=False; try if UseWSDL then begin RIO.WSDLLocation := Addr; RIO.Service := defSvc; RIO.Port := defPrt; end else RIO.URL := Addr; RIO.HTTPWebNode.UseUTF8InHeader := True; //laifd Result := (RIO as GAMidAgentImpl); finally if Result = nil then RIO.Free; end;end;initialization InvRegistry.RegisterInterface(TypeInfo(GAMidAgentImpl), 'http://wsagent.ejb.triman.com'); // InvRegistry.RegisterDefaultSOAPAction(TypeInfo(GAMidAgentImpl), ''); RemClassRegistry.RegisterXSClass(resultinf, 'http://inf.tri.com', 'resultinf');end.在红色的部分,参数是将登入信息包装成xml格式的文件,提交给中间层,可是经过蓝色的部分后,没有返回的信息,也就是说返回也应该是一个xml格式的数据,我对比调试了一下,别人的机器都能返回,并且result := ResInf.intv;//ResInf.intv:=1,而我的是0,问了很多编程高手都未能搞顶,真是郁闷啊,这个问题困扰我好久了啊,如果谁能搞定,我分全给你.急啊.