0

我已经使用 wso2-wsf-ccp 框架编写了一个 Web 服务,并尝试使用 axis2_http_server 运行它,它工作正常。但在现实生活中,当我们在生产中部署时,我们需要在守护进程模式下运行axis2_http_server。我没有看到在守护程序模式下运行axis2_http_server 的任何选项。如果可以的话,有人可以指导我吗..?

4

2 回答 2

0

在 Axis2/C 下部署 Web 服务的最佳方法mod_axis2是使用Apache2。使用此方法时,Axis2/C 将在系统启动时作为 Apache2 模块启动。

此处此处是有关如何配置和安装 Axis2/C 以使用mod_axis2.

或者,如果您不能使用 mod_axis2,Axis2/C 可以使用此 init.d 脚本以守护程序模式启动(它并不完美,但确实有效):

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          axis2c
# Required-Start:    $local_fs $network
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start Axis2/C application server
### END INIT INFO

case "$1" in
  start)
    LOGFILE=/var/log/axis2c.log
    touch $LOGFILE
    chown daemon $LOGFILE
    export AXIS2C_HOME=/usr/local/axis2c
    cd $AXIS2C_HOME/bin
    sudo -Enu daemon sh -c "./axis2_http_server >$LOGFILE 2>&1 &"
    ;;

  stop)
    killall -INT axis2_http_server
    ;;

  restart|force-reload)
    $0 stop
    $0 start
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
esac

将此脚本放置为/etc/init.d/axis2c,使其可执行并启动:

sudo update-rc.d axis2c defaults

之后,Axis2/C 将在每次系统启动时自动加载。

于 2013-08-03T21:16:58.897 回答
0

如上所述,现在我正在尝试在 Apache 上部署我的 Web 服务(作为我使用 axis2_http_server 完成的临时安排),但是在我使用 apache2 和 apr 头文件编译 wso2_wsf_cpp 并尝试使用 apache2 部署我的 Web 服务之后,然后在浏览器中访问 URL,例如:http : //mydomain.com:8080/axis2/services,我没有看到任何事情发生(尽管在浏览器的左下角我看到这条消息“等待 mydomain. com”,一段时间后它也会消失)。我看到的问题是 services.xml,我在其中使用了以下类型的描述:

<service name="imaservice">
   <parameter name="ServiceClass" locked="xsd:false">imaservice</parameter>
   <description>
      IMA service interfaces
   </description>

   <operation name="registeruser">
      <parameter name="RESTMethod">POST</parameter>
      <parameter name="RESTLocation">registeruser</parameter>
      <messageReceiver class="wsf_cpp_msg_recv" />
   </operation>
</service>

我在这一行中发现的问题:“”当我注释掉这一行时,我可以浏览服务,但是在调用 Web 服务时,我看到错误代码“500”。

我发现互联网上的 wso2_wsf_cpp 框架没有太多帮助。我在这方面做了很多研发,但一直没能解决这个问题。任何见解将不胜感激。

于 2013-09-27T13:08:57.010 回答