Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Defining a property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maziar Aflatoun - 29 Mar 2005 21:29 GMT
Hi everyone,

A web service method is declared by
[WebMethod]
public void MyMethod() {
}

However, this doesn't work with get/set property? How would one go about
defining a get/set property in a web service?
ex.

[WebMethod]
 public string custFirstName
 {
  get
  {
   return FirstName;
  }
}

Error: Attribute 'WebMethod' is not valid on this declaration type. It is
valid on 'method' declarations only.

Thank you
Maz.
Brock Allen - 29 Mar 2005 22:09 GMT
WebServices doesn't support properties. This would be a bad precedent as
it skews people's thinking that web services are about objects (and properties)
when they're not.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hi everyone,
>
[quoted text clipped - 19 lines]
> Thank you
> Maz.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.