[Mono-devel-list] WebService + firebird working on xsp, but not on mod-mono

Juan Ramon jramon at sebal.net
Tue Oct 19 08:03:48 EDT 2004


I am trying to develop a simple Web Service with database access
(Firebird). 
The fact is that if I launch xsp and navigate to the test form, it works
correctly. If I do the same but with mod-mono, it returns:

	The remote server returned an error: (500) Internal Server 	Error.
	Unable to complete network request to host "127.0.0.1".

I have checked that it happens just at the point I am filling the
dataset.
I have tried using 127.0.0.1, localhost and a real IP as the "server"
parameter in FbConnection and the result is the same...

Any ideas?
The sourcecode is as follows...

Thanks.

Juan Ramon Gonzalez



<%@ WebService Language="c#" Class="MyServices.Service1" %>
using System.Web.Services;
using FirebirdSql.Data.Firebird;
using System.Data;
namespace MyServices {
[System.Web.Services.WebService(Namespace="http://tempuri.org")]

public class Service1 : System.Web.Services.WebService
{

	[WebMethod()]
	public bool AccessAllowed(string MAC)
	{
		return testMAC(MAC);
	}

	private bool testMAC(string MAC)
	{
		FbConnection Conexion = new
FbConnection("database=/opt/firebird/databases/test.FDB;user=sysdba;password=masterkey;dialect=3;server=127.0.0.1");
		try {
		
			FbDataAdapter da = new FbDataAdapter("SELECT * FROM PC WHERE MAC='" +
MAC + "'", Conexion);
	
			DataSet ds = new DataSet();
			da.Fill(ds, "PC");
			foreach (DataRow row in ds.Tables["PC"].Rows) {

					if ((row["MAC"].ToString() == MAC) && (row["ALLOWED"].ToString() ==
"1")) {
					return true;
				} else {
					return false;
				}

			

			}
			return false;
		} finally {
			Conexion.Dispose();
		}

return(false);
	}

}
}





More information about the Mono-devel-list mailing list