[Mono-list] Error in web service method.
Tizio Incognito
tizioincognito@tiscali.be
Tue, 20 Jul 2004 11:03:45 +0200
beniniva@csr.unibo.it said the following on 20/07/2004 10.52:
>Hi,
>when I try to test the web service LoginService.asmx
>(http://localhost/mono/LoginService.asmx), the method "Login" and "LogOut" go
>well, instead "TestLogin" give me only this message:
>---------------------
>The remote server returned an error: (500) Internal Server Error.
>Object reference not set to an instance of an object
>----------------------
>
>
>
[SNIP]
> //TEST LOGIN
> //Metodo che verifica il contenuto della variabile di Sessione "Login"
> [WebMethod (EnableSession=true)]
> public string TestLogin ()
> {
> //se la variabile di sessione non è vuota, significa che l'utente si è logato, quindi recupero alcuni dati su di lui, ad esempio il "ruolo aziendale"
> if ((string)Session["Login"]!= null)
>
>
Ciao Valentina,
I don't know exactly how it works with C#, but I think you may check if
Session["Login"] is *nothing* instead of null (however, this is how it
works with VB)
--
T.I.