By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,718 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,718 IT Pros & Developers. It's quick & easy.

<WebMethod()> In Front Of Each public function ?

P: n/a
Hi,

i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?
--
Best Regards ,

Tiraman :-)
Nov 20 '05 #1
Share this Question
Share on Google+
8 Replies

P: n/a
* Tiraman <ti*****@netvision.net.il> scripsit:
i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?


Why do you want to do that?!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Webmethod indicates that it is a callable method of a web service. Public
means that is available to other classes in the assembly. 2 different
things.

It could be public to the assembly but not callable via a web service.
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:uM*************@tk2msftngp13.phx.gbl...
Hi,

i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?
--
Best Regards ,

Tiraman :-)

Nov 20 '05 #3

P: n/a
bcz in that way there is no need to change the code when i will be ask to
make the function available for the web.

the question is why not ?
is it a performance issue ?

10x

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:MP************************@127.0.0.1...
* Tiraman <ti*****@netvision.net.il> scripsit:
i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?


Why do you want to do that?!

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #4

P: n/a
ok but as far as i know it can't be private in the assembly and callable via
a web service.
"Scott M." <s-***@nospam.nospam> wrote in message
news:#v**************@TK2MSFTNGP09.phx.gbl...
Webmethod indicates that it is a callable method of a web service. Public
means that is available to other classes in the assembly. 2 different
things.

It could be public to the assembly but not callable via a web service.
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:uM*************@tk2msftngp13.phx.gbl...
Hi,

i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?
--
Best Regards ,

Tiraman :-)


Nov 20 '05 #5

P: n/a
Sure it can....and that's the point!
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
ok but as far as i know it can't be private in the assembly and callable via a web service.
"Scott M." <s-***@nospam.nospam> wrote in message
news:#v**************@TK2MSFTNGP09.phx.gbl...
Webmethod indicates that it is a callable method of a web service. Public means that is available to other classes in the assembly. 2 different
things.

It could be public to the assembly but not callable via a web service.
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:uM*************@tk2msftngp13.phx.gbl...
Hi,

i have a class with few functions which some of them are public.

why not to put the <WebMethod()> in front of each public function as a
concept ?
--
Best Regards ,

Tiraman :-)



Nov 20 '05 #6

P: n/a
* Tiraman <ti*****@netvision.net.il> scripsit:
bcz in that way there is no need to change the code when i will be ask to
make the function available for the web.

the question is why not ?
is it a performance issue ?


IMO it simply doesn't make sense. I would mark methods as webmethod "by
need" so the code is easier to understand. When marking every method as
webmethod, this would semantically make no sense for most methods.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #7

P: n/a
Ok.

10x

"Scott M." <s-***@nospam.nospam> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
Sure it can....and that's the point!
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
ok but as far as i know it can't be private in the assembly and callable

via
a web service.
"Scott M." <s-***@nospam.nospam> wrote in message
news:#v**************@TK2MSFTNGP09.phx.gbl...
Webmethod indicates that it is a callable method of a web service. Public means that is available to other classes in the assembly. 2 different
things.

It could be public to the assembly but not callable via a web service.
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:uM*************@tk2msftngp13.phx.gbl...
> Hi,
>
> i have a class with few functions which some of them are public.
>
> why not to put the <WebMethod()> in front of each public function as a > concept ?
>
>
> --
> Best Regards ,
>
> Tiraman :-)
>
>



Nov 20 '05 #8

P: n/a
ok,
i got your point.

10x

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:MP************************@127.0.0.1...
* Tiraman <ti*****@netvision.net.il> scripsit:
bcz in that way there is no need to change the code when i will be ask to make the function available for the web.

the question is why not ?
is it a performance issue ?


IMO it simply doesn't make sense. I would mark methods as webmethod "by
need" so the code is easier to understand. When marking every method as
webmethod, this would semantically make no sense for most methods.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.