Last post Jul 26, 2013 09:27 AM by tomkmvp
Jul 25, 2013 04:47 PM|tomkmvp|LINK
I have an asmx web service that I have setup in my web project in VS as Add Service Reference -> Advanced -> Add Web Reference, and then I added a "using mysvc;" reference to my C# code. When I am writing the code and want to call a webmethod from the asmx,
I thought I would be able to code it as "mysvc.somemethod()", but I am only getting .WebServiceSoap, .WebServiceSoapClient, and .WebServiceSoapChannel as options from intellisense.
What am I doing wrong or misunderstanding? Is there a good tutorial or reference someone can point me to?
Jul 26, 2013 12:11 AM|anuj_koundal|LINK
First of all you have to create an object of WebServiceSoapClient after then you would able to call methods.
WebServiceSoapClient obj =new WebServiceSoapClient ();
Jul 26, 2013 01:29 AM|aspnet2sams|LINK
He is right with just an edit. that is do like
mysvc websvc = new mysvc();
The intellisense is showing the reference that a web reference exists in project i presume that.
Jul 26, 2013 09:27 AM|tomkmvp|LINK
Yes, that's it! Thanks.