[Webmethod] attribute doen't work for properties inWebservic

S

sunnyz

i am using property in Webservice.But [WebMethod] attribute doesn'
work for properties.Cud any1 tell me plz which attribute to use for
properties

thx

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
R

Robert Jordan

sunnyz said:
i am using property in Webservice.But [WebMethod] attribute doesn'
work for properties.Cud any1 tell me plz which attribute to use for
properties

public int Property {
[WebMethod]
get {
}
[WebMethod]
set {
}
}
 
N

Nicholas Paldino [.NET/C# MVP]

I would say that this is a very bad thing though, if anything, you
should provide accessor functions which take the place of properties. It
fits more in line with the nature of the transport, as well as the thinking
behind web services in general.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Robert Jordan said:
sunnyz said:
i am using property in Webservice.But [WebMethod] attribute doesn'
work for properties.Cud any1 tell me plz which attribute to use for
properties

public int Property {
[WebMethod]
get {
}
[WebMethod]
set {
}
}
 
R

Richard Blewett [DevelopMentor]

The technical answer has already been given. However, this sounds to me like you may have a design issue. Why do you want to expose a property as a web service. Remoted calls should be "chunky" in that they send alot of data in one go rather than "chatty" where they send a small amount of data in lots of calls. Properties sound like a very chatty interface to me and lots of network roundtrips = poorly performing cliient application

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

i am using property in Webservice.But [WebMethod] attribute doesn'
work for properties.Cud any1 tell me plz which attribute to use for
properties

thx
 
R

Robert Jordan

Nicholas said:
I would say that this is a very bad thing though, if anything, you
should provide accessor functions which take the place of properties. It
fits more in line with the nature of the transport, as well as the thinking
behind web services in general.

Well. That's not my problem ;-)

bye
Rob
 

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