各位救我,我编的提供Web服务的dll文件一直死机?

xxzzyy 2002-02-23 06:06:54
我给公司编写了一个提供数据交换web服务的Dll文件,放在公司的网站上,但就是经常死,我用的是soap协议,下面是代码的一部分:
type
TDataExchange = Class ( TInvokableClass, IDataExchange)
private
CompressionLevel: TCompressionLevel);
Protected
//发送注册信息
function SendRegesterInfo(RegesterInfo:TXSBase64):integer;Stdcall;
End;

function TDataExchange.SendRegesterInfo(RegesterInfo:TXSBase64):integer;Stdcall;
var
//定义变量
TempAdoConnection:TAdoConnection;
TempQuery:TAdoQuery;
MainStringList:Tstringlist; //整体的文档列表
TmpStream:TMemoryStream; //临时的内存流变量
TempCount:integer; //整体计数器
sValue:string; //临时值
GroupId,ShortName,Fullname,Province,City,Phone,PhoneHead,LinkMan,Fax,PostAddress,
PostCode,Email,stockAddress,stockMan,StockPostCode,StockStation,NewRegesterUser,
OldRegesterUser,NewRegesterPassword,OldRegesterPassword,UserType,RegesterClass:string; //注册参数
begin
Result:=0;//默认为成功


TempAdoConnection:=TAdoconnection.Create(nil);
TempAdoConnection.ConnectionString:='Provider=SQLOLEDB.1;Password=33;Persist Security Info=True;User ID=33;Initial Catalog=Emanage;Data Source=33;
TempAdoConnection.KeepConnection:=true;
TempAdoConnection.CursorLocation:=clUseClient;
TempAdoconnection.LoginPrompt:=false;
try
TempAdoConnection.Open;
except
TempAdoConnection.Free;
raise EExchangeError.Create('商务中心数据库无法连通!',ERROR_DATABASE_CONNECT);
end;
TempQuery:=TAdoQuery.Create(nil);
TempQuery.Connection:=TempAdoConnection;
//优化ADO执行效率
TempQuery.CursorLocation:=clUseClient;
TempQuery.CursorType :=ctStatic;
TempQuery.LockType :=ltReadOnly;
TempQuery.CacheSize :=1000;
TempQuery.Prepared :=True;


//解释注册信息,处理注册信息,同时返回有关的信息。
MainStringList:=TStringList.Create;
MainStringList.Clear;
TmpStream:=TmemoryStream.Create ;
RegesterInfo.SaveToStream(TmpStream);
UnCompressData(Tmpstream);
MainStringList.LoadFromStream(TmpStream);
for TempCount:=0 to (MainStringList.count-1) do
begin
//空行*******************************
if Trim(MainStringlist[TempCount])='' then

//无标签行****************************************
else if (copy(Trim(MainStringList[TempCount]),1,1)<>'<') and
(Pos(Trim('</'),Trim(MainStringList[TempCount]))<0) then
begin
SValue:=SValue+Trim(MainStringList[TempCount]);
end

else if Pos(Trim('<ShortName>'),Trim(MainStringList[TempCount]))>0 then
begin
if Pos(Trim('</ShortName>'),Trim(MainStringList[TempCount]))>0 then
begin
ShortName:=seekvaluebynode('ShortName',Mainstringlist[TempCount],0);
end
else
begin
sValue:=SeekValueByNode('ShortName',Mainstringlist[TempCount],1);
end;

end
else if Pos(Trim('</ShortName>'),Trim(MainStringList[TempCount]))>0 then
begin
sValue:=sValue+SeekValueByNode('ShortName',Mainstringlist[TempCount],2);
ShortName:=sValue;
end

else if Pos(Trim('<FullName>'),Trim(MainStringList[TempCount]))>0 then
begin
if Pos(Trim('</FullName>'),Trim(MainStringList[TempCount]))>0 then
begin
FullName:=seekvaluebynode('FullName',Mainstringlist[TempCount],0);
end
else
begin
sValue:=SeekValueByNode('FullName',Mainstringlist[TempCount],1);
end;

end
else if Pos(Trim('</FullName>'),Trim(MainStringList[TempCount]))>0 then
begin
sValue:=sValue+SeekValueByNode('FullName',Mainstringlist[TempCount],2);
FullName:=sValue;
end
.......

整个程序很多,这里是一个代表部分,各位给我提个建议,谢谢各位。
...全文
64 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

830

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧