V
VegatableBird
Unregistered / Unconfirmed
GUEST, unregistred user!
现要做WebService,用kylix3开发,web服务为Apache
我先是在Windows上开发,工具Delphi7,其间基于Apache1.*、Apache2.*都试过,Apache版本分别为1.2.38和2.0.53。
新建一WebService工程,Apache2.* Shared Module(DLL),命名为helloWorldP,修改apache_module name 'helloWorld_module';
Delphi提示“Create Interface for SOAP module”选择“yes”,Service name为helloWorld。在创建出的helloWorldImpl.pas和helloWorldIntf.pas中加入function GetMyStrs: String; stdcall;简单返回一个字符串
编译后copyhelloWorldP.dll文件到Apache的modules目录下,修改conf目录下的http.conf文件,加入如下文字:
LoadModule helloWorld_module "D:/dev/Apache Group/Apache2/modules/helloWorldP.dll"
<Location /helloWorld2>
SetHandler helloWorldP-handler
</Location>
重起Apache2服务(Apache1类似)
打开IE,地址栏输入“http://127.0.0.1/helloWorld2”,可以看到WSDL等信息,其接口GetMyStrs可以被其他客户端调用。
现在要转移到Linux上。从网上下载httpd-2.0.53.tar.gz,解压后,进入该目录编译安装
./configure -enable-so
make
make install
将HTTPD2、ApacheTwoHTTP和ApacheTwoApp源码copy到kylix的source/internet下。同样建立WebService工程,将引用的ApacheApp改为ApacheTwoApp,但其他HTTPD2、ApacheTwoHTTP两个文件我没有用到。compile工程编译通过,Build会有警告:
[Warning] xdom.pas(16372): Error converting locale string 'im fentlichen Dokument ' to Unicode. String truncated. Is your LANG environment variable set correctly?
不知该警告是否影响到Apache无法装载该模块?
copy生成的libhelloWorldP.so到apache2的modules目录下,修改conf目录下的http.conf文件,加入如下文字:
LoadModule helloWorld_module modules/libhelloWorldP.so
<Location /helloWorld2>
SetHandler libhelloWorldP-handler
</Location>
重起apache服务,报错:“../bin/apachectl: line 100: 5162 Segmentation fault $HTTPD -k $ARGV”
看到有帖子讲要修改HTTPD2.pas文件,但我没有引用该文件,还是试了一下
MODULE_MAGIC_NUMBER_MAJOR = 20020612;这句注释掉,改为
MODULE_MAGIC_NUMBER_MAJOR = 20020903; { Apache 2.0.51..54 }
MODULE_MAGIC_NUMBER_MINOR = 1;这句注释掉,改为
MODULE_MAGIC_NUMBER_MINOR = 9;
conn_rec = {$IFDEF LINUX}packed{$ENDIF} record这句之前加了
ap_conn_keepalive_e = (AP_CONN_UNKNOWN, AP_CONN_CLOSE, AP_CONN_KEEPALIVE);
找到
(** Are we still talking? *)
flags: Cardinal;
{ The following are in the flags bitset:
unsigned aborted:1;
(** Are we going to keep the connection alive for another request?
* -1 fatal error, 0 undecided, 1 yes *)
signed int keepalive:2;
(** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
* 1 yes/success *)
signed int double_reverse:2;
}
这一段,改为:
(** Are we still talking? *)
flags1: Cardinal;
{ The following are in the flags bitset:
unsigned aborted:1; }
(** Are we going to keep the connection alive for another request?
* @see ap_conn_keepalive_e *)
keepalive: ap_conn_keepalive_e;
还是不行,请各位大侠指教
小弟刚刚注册,没有分送,见谅
我先是在Windows上开发,工具Delphi7,其间基于Apache1.*、Apache2.*都试过,Apache版本分别为1.2.38和2.0.53。
新建一WebService工程,Apache2.* Shared Module(DLL),命名为helloWorldP,修改apache_module name 'helloWorld_module';
Delphi提示“Create Interface for SOAP module”选择“yes”,Service name为helloWorld。在创建出的helloWorldImpl.pas和helloWorldIntf.pas中加入function GetMyStrs: String; stdcall;简单返回一个字符串
编译后copyhelloWorldP.dll文件到Apache的modules目录下,修改conf目录下的http.conf文件,加入如下文字:
LoadModule helloWorld_module "D:/dev/Apache Group/Apache2/modules/helloWorldP.dll"
<Location /helloWorld2>
SetHandler helloWorldP-handler
</Location>
重起Apache2服务(Apache1类似)
打开IE,地址栏输入“http://127.0.0.1/helloWorld2”,可以看到WSDL等信息,其接口GetMyStrs可以被其他客户端调用。
现在要转移到Linux上。从网上下载httpd-2.0.53.tar.gz,解压后,进入该目录编译安装
./configure -enable-so
make
make install
将HTTPD2、ApacheTwoHTTP和ApacheTwoApp源码copy到kylix的source/internet下。同样建立WebService工程,将引用的ApacheApp改为ApacheTwoApp,但其他HTTPD2、ApacheTwoHTTP两个文件我没有用到。compile工程编译通过,Build会有警告:
[Warning] xdom.pas(16372): Error converting locale string 'im fentlichen Dokument ' to Unicode. String truncated. Is your LANG environment variable set correctly?
不知该警告是否影响到Apache无法装载该模块?
copy生成的libhelloWorldP.so到apache2的modules目录下,修改conf目录下的http.conf文件,加入如下文字:
LoadModule helloWorld_module modules/libhelloWorldP.so
<Location /helloWorld2>
SetHandler libhelloWorldP-handler
</Location>
重起apache服务,报错:“../bin/apachectl: line 100: 5162 Segmentation fault $HTTPD -k $ARGV”
看到有帖子讲要修改HTTPD2.pas文件,但我没有引用该文件,还是试了一下
MODULE_MAGIC_NUMBER_MAJOR = 20020612;这句注释掉,改为
MODULE_MAGIC_NUMBER_MAJOR = 20020903; { Apache 2.0.51..54 }
MODULE_MAGIC_NUMBER_MINOR = 1;这句注释掉,改为
MODULE_MAGIC_NUMBER_MINOR = 9;
conn_rec = {$IFDEF LINUX}packed{$ENDIF} record这句之前加了
ap_conn_keepalive_e = (AP_CONN_UNKNOWN, AP_CONN_CLOSE, AP_CONN_KEEPALIVE);
找到
(** Are we still talking? *)
flags: Cardinal;
{ The following are in the flags bitset:
unsigned aborted:1;
(** Are we going to keep the connection alive for another request?
* -1 fatal error, 0 undecided, 1 yes *)
signed int keepalive:2;
(** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
* 1 yes/success *)
signed int double_reverse:2;
}
这一段,改为:
(** Are we still talking? *)
flags1: Cardinal;
{ The following are in the flags bitset:
unsigned aborted:1; }
(** Are we going to keep the connection alive for another request?
* @see ap_conn_keepalive_e *)
keepalive: ap_conn_keepalive_e;
还是不行,请各位大侠指教
小弟刚刚注册,没有分送,见谅