WEBSERVICES+Ora9201的问题。300分(300分)

  • 主题发起人 主题发起人 djdsz
  • 开始时间 开始时间
D

djdsz

Unregistered / Unconfirmed
GUEST, unregistred user!
用D7+Oracle9.2.0.1做WEBSERVICES,代码如下:

ISoapData = interface(IInvokable)
['{5AD94F02-B8EE-4ABE-A011-6CE522C75CDB}']

{ Methods of Invokable interface must not use the default }
{ calling convention; stdcall is recommended }
end;

TSoapData = class(TInvokableClass, ISoapData)
private
Connection:TSQLConnection;
public
constructor Create;override;
end;

constructor TSoapData.Create;
begin
Connection:=TSQLConnection.create(nil);
//set Connectparams
connection.connectioned:=true; //错误,无法装载OCI.dll
end;

WEBServices是ISAPI/NSAPI格式的,如果在上面过程中设置连接参数的时候使用SQL Server
就不会有错,是什么原因啊?似乎我写的ISAPI连接Oracle总不能成功!!!
 
我现在用Apache2.043解决了,可是用IIS还是照样。
 
呵呵,应该是IIS的问题了,IIS中出问题的代码如下:
{$J+}
unit soapbase;

interface

uses
SysUtils,SqlExpr,DBXpress, DB,SimpleDS,IniFiles,encddecd;

const
ServerType :String='ORACLE';
ConStr :String='';
LicCou :Word=0;
CliCount :word=0;
License :Int64=0;

var
Connection :TSQLConnection;
SQLCache :TSimpleDataSet;
Ini :TIniFile;

implementation

initialization
Connection:=nil;
SQLCache:=nil;
ini:=TiniFile.Create('ServerSet.Ini');
try
try
ServerType:=ini.ReadString('Current Setting','DBServer','ORACLE');
ConStr:=decodestring(ini.ReadString('Current Setting','ConnectParam',''));
LicCou:=ini.ReadInteger('Current Setting','LicenseValue',0);
License:=strtoint64(ini.ReadString('Current Setting','LicenseKey',''));
Connection:=TSQLConnection.Create(nil);
Connection.ConnectionName:='MYSOAPSRV';
Connection.DriverName:=ServerType;
Connection.Params.CommaText:=ConStr;
Connection.GetDriverFunc:=Connection.params.Values['GetDriverFunc'];
Connection.LibraryName:=Connection.Params.Values['LibraryName'];
Connection.vendorlib:=Connection.Params.Values['vendorlib'];
Connection.loginprompt:=false;
Connection.Connected:=true; //出错,不能装载OCI.dll,M$ SQL就不会,Apache中是正确的
SQLCache:=TSimpleDataSet.Create(nil);
SQLCache.Connection:=Connection;
SQLCache.DataSet.CommandText:='SELECT * FROM APPINF';
SQLCache.Open;
except
end;
finally
ini.Free;
end;
finalization
if SQLCache<>nil then
SQLCache.Free;
if Connection<>nil then
Connection.Free;
end.

Apache版本是2.0.43,IIS版本是5.0。看来IIS和ORACLE的兼容性可能有问题。
 
有可能是权限或者环境变量的设置问题
你要看看你的系统PATH中是否包括了ORACLE的相关路径,如果已经有了
那就可能是权限问题,你换个用户启动IIS再试试。
 
path中有ORACLE目录的,我用的是Administrator登陆的系统,应该不是权限问题的。
如果IIS权限问题,应该M$ SQL也会出问题的。
 
你说的PATH是指系统PATH还是用户PATH,要前者才行。
跟你用什么登录无关
IIS默认是用SYSTEM用户启动的
你试试把SYSTEM改成Administrator
 
都不行的啊
 
后退
顶部