WebMethod() is this nasasary

S

Slim

I am a ASP developer, just getting used to asp.net. I must say as a former
critic I'm really starting to like asp.net
I have just made some webservices,

when you create a new web service it already has this tag above the default
function
<WebMethod()> _

what is this, is it necessary, should it be above all functions, all public
function just the first or can I delete it?
 
M

Michael Nemtsev

Hello Slim,

This attribute mark you method being visible via WSDL and exported method
to the client to be called

S> I am a ASP developer, just getting used to asp.net. I must say as a
S> former
S> critic I'm really starting to like asp.net
S> I have just made some webservices,
S> when you create a new web service it already has this tag above the
S> default
S> function
S> <WebMethod()> _
S> what is this, is it necessary, should it be above all functions, all
S> public function just the first or can I delete it?
S>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
S

Scott M.

You must have methods of your web service that you wish to be able to access
via web service method calls marked with this attribute. Without it, the
method can only be called by code within the web service, but not by the
caller of the web service.
 
S

Scott M.

Also...Why were you a former critic of ASP.NET? I was a Classic ASP
developer for years and couldn't wait for ASP.NET to come out (2/2002).
There is just no comparison between the two. There isn't anything that
Classic ASP offers that ASP.NET can't do beter, faster or easier.
 
S

Slim

Michael Nemtsev said:
Hello Slim,

This attribute mark you method being visible via WSDL and exported method
to the client to be called

i understand

but I am able to cal them, is that because they are in the same web site?
I just have the statment once, should i have it before each method?
 
S

Slim

Scott M. said:
Also...Why were you a former critic of ASP.NET? I was a Classic ASP
developer for years and couldn't wait for ASP.NET to come out (2/2002).
There is just no comparison between the two. There isn't anything that
Classic ASP offers that ASP.NET can't do beter, faster or easier.


I also could not wait, but I found .net clumsy and could not see the
advantage.
I have changed my mind now, although I still thing classic ASP has its place

I still don't like the controls much, they are good when the fit your need,
but some times its better just to manipulate the html output as you would in
ASP.
 
M

Michael Nemtsev

Hello Slim,

S> S>S> i understand
S> but I am able to cal them, is that because they are in the same web
S> site? I just have the statment once, should i have it before each
S> method?

You need to apply this attribute to the *each* method you want be available
for the consumen.
It's only particular case that u can see methods within the WS in the solution.
It's not the normal state using WS, because
consumer can only see proxy, that is generated by your WebMethod attributes.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
S

Slim

Michael Nemtsev said:
Hello Slim,

S> S>
S> i understand
S> but I am able to cal them, is that because they are in the same web
S> site? I just have the statment once, should i have it before each
S> method?

You need to apply this attribute to the *each* method you want be
available for the consumen.
It's only particular case that u can see methods within the WS in the
solution. It's not the normal state using WS, because
consumer can only see proxy, that is generated by your WebMethod
attributes.

ok


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche
 
C

Cor Ligthert [MVP]

Slim,

Is it possible that you use ASPNet the same as ASP. You can use ASPNET in 3
ways.

The same as ASP where the code is written inside the HTML
With a code behind page where the code behind stays on the website
With code behind where the code is used in a DLL for all users.

I use the last as you probably already had understand.

Cor
 
S

Slim

Cor Ligthert said:
Slim,

Is it possible that you use ASPNet the same as ASP. You can use ASPNET in
3 ways.

The same as ASP where the code is written inside the HTML
With a code behind page where the code behind stays on the website
With code behind where the code is used in a DLL for all users.

This is the same way I use ASP, the ASP is for presenting the data, I use
com+ dll's to do the work.
Its not that much different in what it does but how it does it
 
C

Cor Ligthert [MVP]

This is the same way I use ASP, the ASP is for presenting the data, I use
com+ dll's to do the work.
Its not that much different in what it does but how it does it
I would not say so because you use to connect with your Com+ serverside
scripting.
With ASPNET all your serverside is real Net dll code.

Not such a little difference in my opinion.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top