-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: ConfinedVivek
Message 1 in Discussion
Can we define constructor with arguments in web service.
So, suppose the Web service.asmx file looks like: public class Service2 :
System.Web.Services.WebService
{
string b = null;
public Service2()
{
InitializeComponent();
}
public Service2(string b1)
{
b = b1;
}
[WebMethod]
public string HelloWorld(string vivs)
{
return vivs+ b;
} and at client side, I am creating proxy object like:
WebService1.localhost.Service2 obj = new WebService1.localhost.Service2("Hello");
string myname = obj.HelloWorld("vivekagarwal");
Response.Write(myname); But the problem is, i am getting error while creating
object with passing argument ("Hello").
It is saying that we can't pass the argument.(Even when I have created the default
constructor with no-argument)
any body has any idea???..becaz my primary function here is..to initialize the object
upon creation...
Thanks
-Vivek Agarwal
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]