473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
8 1272
* 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
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
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
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
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
* 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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Bob Rock | last post by:
Hello, when serializing an array of elements of a class Classname using XmlSerializer.Serialize() I get an XML like the following: <?xml version="1.0"> <ArrayOfClassname> ....... ..........
5
by: Earl Damron | last post by:
Hello All. Is it possible to create a Web service with C# that returns a response with two different elements in the SOAP Body? I'm thinking of something like this: <?xml version="1.0"...
6
by: Ambuj | last post by:
Can anyone please help me understand why this is not working?!?! I have got this code in a C# Web service project, the project compiles correctly but I can't see the description when I access the...
0
by: Michael Jackson | last post by:
I have attempted to mark up a service and it's methods so that it doesn't require the SOAPAction HTTP header to resolve the methods being called, this is done from first element in <SOAP-ENV:Body>...
0
by: pranesh.nayak | last post by:
Hello Group, (tech: C#, VS2005) I'm facing a problem in passing Nullable<DateTimeto a webservice. Below is code in webservice wrapper (reference.cs) used set/get date. When i set date value...
2
by: weird0 | last post by:
I am testing a webservice locally that connects to BankingDb and check the function public bool CheckPincode(string Pincode) { SqlConnection sqlConnection1 =new...
2
by: adh | last post by:
In c# you can return a String() but in VB.NET2005 it does not work (the webservice test sends to the error page). See MS AJAX Controls Toolkit.Autocomplete which demands a String() reply. I...
0
by: nappingcub | last post by:
This is my first time coding a web service in .NET and ran into a slight snag that I was hoping that anyone could help me out on. I'm using the generic Hello World web service that is stubbed out on...
0
by: arunairs | last post by:
Hi, I am developing a web service which will be used in an intranet. I would like one of its methods to return a List<Customer>. Eventhough my web service contains a method : public...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.