1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

web services on Nginx

Discussion in 'Nginx' started by grz, Dec 17, 2013.

  1. #1
    I try to run a web service (written in mono C#) under nginx. When I write the url in my browser I can see the web service, the WSDL the proxy client and the web service’s function called Add (see bellow). But when I try to run the Add function it always returns “0 –“ (The Add function just adds two numbers). In the same folder there is an aspx page which runs without error!!!

    The environment is Ubuntu server 12.04 and I have installed the following packages:
    sudo apt-get install mono-complete (version 2.10.8.1)
    sudo apt-get install nginx
    sudo apt-get install mono-fastcgi-server4

    The configuration is:

    1. In file /etc/nginx/sites-enabled/default I have change the listening port 20 8299:

    listen 8299; ## listen for ipv4; this line is default and implied

    2. In file /etc/nginx/nginx.conf I have added the following server section inside http section:

    server {
    listen *:8299;
    server_name UTest;
    access_log logs/dictionary3.access.log;
    error_log logs/dictionary3.error.log;
    location /dictionary3 {
    root /etc/nginx/www;
    index index.html index.htm index.aspx;
    fastcgi_index index.aspx;
    fastcgi_pass 127.0.0.1:9000;
    include /etc/nginx/fastcgi_params;
    }
    }


    3. I have added the following lines into file /etc/nginx/fastcgi_params as well

    fastcgi_param PATH_INFO "";
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


    I start the services using the commands

    sudo service nginx start
    fastcgi-mono-server4 /applications=/dictionary3:/etc/nginx/www/dictionary3 /socket=tcp:127.0.0.1:9000 /logfile=/var/log/mono/fastcgi.log

    The fastcgi.log :

    [2013-12-17 06:54:39Z] Notice Beginning to receive records on connection.
    [2013-12-17 06:54:39Z] Warning Duplicate name, SCRIPT_FILENAME, encountered. Overwriting existing value.
    [2013-12-17 06:54:43Z] Error Failed to process connection. Reason: The object was used after being disposed.
    [2013-12-17 06:54:43Z] Notice Beginning to receive records on connection.
    [2013-12-17 06:54:43Z] Warning Duplicate name, SCRIPT_FILENAME, encountered. Overwriting existing value.
    [2013-12-17 06:54:43Z] Error Failed to process connection. Reason: The object was used after being disposed.
    [2013-12-17 07:03:58Z] Notice Beginning to receive records on connection.
    [2013-12-17 07:03:58Z] Warning Duplicate name, SCRIPT_FILENAME, encountered. Overwriting existing value.
    [2013-12-17 07:03:58Z] Error Failed to process connection. Reason: The object was used after being disposed.

    The web service is:

    namespace WebApplication6
    {
    [WebService(Namespace = "somenamespace")]
    public class WebService1 : System.Web.Services.WebService
    {

    [WebMethod]
    public int Add(int a, int b)
    {
    return a+b;
    }
    }

    }


    The real strange thing is that I can see the Add method but when I run it the service returns 0-. Moreover , as I said, an aspx page runs smoothly:(.


    Any idea?
     
    grz, Dec 17, 2013 IP
  2. Jao

    Jao Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    Hello grz!
    I got stuck in this same issue with Raspberry PI + Debian + NGINX + Mono.
    Do you find solution to this?
     
    Jao, Aug 5, 2014 IP