Question

I have written a web service using wso2-wsf-ccp framework and trying to run it with axis2_http_server and it works fine. But in real life when we deploy in production we need to run axis2_http_server in daemon mode. I dont see any option to run axis2_http_server in daemon mode. Can someone guide me if it is possible to do so..?

Était-ce utile?

La solution

Best method to deploy web services under Axis2/C is to use mod_axis2 for Apache2. When this method is used Axis2/C will be started as Apache2 module on system startup.

Here and here are documentations on how to configure and install Axis2/C to build with mod_axis2.

Alternatively, if you can't use mod_axis2, Axis2/C can be started in daemon mode using this init.d script (it's not perfect but does work):

#!/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

Place this script as /etc/init.d/axis2c, make it executable and start:

sudo update-rc.d axis2c defaults

After that Axis2/C will be automatically loaded on each system startup.

Autres conseils

As suggested above, now I am trying to deploy my web-services on Apache (as a make shift arrangement I had done using axis2_http_server), but after I compiled wso2_wsf_cpp with apache2 and apr header files and trying to deploy my web-services with apache2, and access the URL in the browser, for e.g.: http://mydomain.com:8080/axis2/services, I dont see anything happening(though in the botton left corner of the browser i see this message "waiting for mydomain.com" and that too vanishes after some time). The problem that I see is with the services.xml where I use the following kind of description:

<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>

The problem I am finding in this line: "" When I comment this line out, I am able to browse, the services, but when calling the web-services, I see the error code "500".

I find that there is not much help is available with wso2_wsf_cpp framework on the internet. I did lot of R&D on this, but haven't been able to fix this issue. Any insight will be greatly appreciated.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top