I've this problem: i'm trying to build a method that outputs an object like
this:
public class Autenticazione
{
public string Username
{
set
{
Username=value;
}
get
{
return Username;
}
}
public string Password
{
set
{
Password=value;
}
get
{
return Password;
}
}
The WebService implementation is this:
public class Service1 : System.Web.Services.WebService
{
public static Autenticazione aut;
public Service1()
{
InitializeComponent();
aut = new Autenticazione();
aut.Username="username di prova";
aut.Password="password di prova";
}
[WebMethod]
public Autenticazione get_Autenticazione()
{
return aut;
}
When i try to call the method, i receive this response:
Request format is unrecognized.
Is there anyone who can help me?
Thanks
Francesca
erymuzuan - 06 Apr 2005 15:15 GMT
it was suprising. you didn't get StackOverFlowException
try this instead
public class Autenticazione
{
private string m_userName;
private string m_password;
public string Username
{
set
{
m_userName = value;
}
get
{
return m_userName;
}
}
public string Password
{
set
{
m_password = value;
}
get
{
return m_password;
}
}
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
InitializeComponent();
}
[WebMethod]
public Autenticazione get_Autenticazione()
{
Autenticazione aut = new Autenticazione();
aut.Username="username di prova";
aut.Password="password di prova";
return aut;
}
}
regards
erymuzuan
Merighi - 06 Apr 2005 15:35 GMT
i forgot try/get use, Thanks.
> it was suprising. you didn't get StackOverFlowException
> try this instead