[Mono-dev] Web Services Problem
Ko Ko
kkl_sg at yahoo.com
Fri Sep 30 05:01:02 EDT 2005
Hi,
I have Web Client Program
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Services;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using MySql.Data.MySqlClient;
using wa.ws;
namespace wa
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtUser;
protected System.Web.UI.WebControls.TextBox txtPassword;
protected System.Web.UI.WebControls.Label lblUser;
protected System.Web.UI.WebControls.Label lblPassword;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
protected System.Web.UI.WebControls.Label lblLogin;
protected System.Web.UI.WebControls.Button btnLogin;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnLogin_Click(object sender, System.EventArgs e)
{
DataSet ds;
wa.ws.Fotohub client = new Fotohub();
ds=client.UserLogin(txtUser.Text,txtPassword.Text);
if(ds.Tables[0].Rows.Count>0)
{
lblLogin.Text="You are valid user";
}
else
{
lblLogin.Text="You are not a valid user";
}
}
}
}
And server program
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Services;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using MySql.Data.MySqlClient;
using wa.ws;
namespace wa
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtUser;
protected System.Web.UI.WebControls.TextBox txtPassword;
protected System.Web.UI.WebControls.Label lblUser;
protected System.Web.UI.WebControls.Label lblPassword;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
protected System.Web.UI.WebControls.Label lblLogin;
protected System.Web.UI.WebControls.Button btnLogin;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnLogin_Click(object sender, System.EventArgs e)
{
DataSet ds;
wa.ws.Fotohub client = new Fotohub();
ds=client.UserLogin(txtUser.Text,txtPassword.Text);
if(ds.Tables[0].Rows.Count>0)
{
lblLogin.Text="You are valid user";
}
else
{
lblLogin.Text="You are not a valid user";
}
}
}
}
Both working fine on Microsoft .Net using Windows XP. When I try to run the web services on Linux and using Windows XP to run the web application to invoke the web services, it keep giving me this error.
c:\inetpub\wwwroot\wa\Login.aspx.cs(62): Cannot implicitly convert type 'System.Xml.XmlElement' to 'System.Data.DataSet'
I wanted to know why the program recognize the method UserLogin as XMLElement instead of dataset. When I run both webservice and application on the Windows XP .Net framework, web application does recognize UserLogin method as Dataset.
Is there any compatibility problem btwn .Net and Mono? And I notice the .disco file produce from .Net and Mono are quite different too.
Regards,
Ko Ko
Reality starts with Dream
---------------------------------
Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050930/91187613/attachment.html
More information about the Mono-devel-list
mailing list