473,387 Members | 1,724 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,387 software developers and data experts.

[Webmethod] attribute doen't work for properties inWebservic

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
*-----------------------*
Nov 16 '05 #1
4 2136
sunnyz wrote:
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 {
}
}
Nov 16 '05 #2
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]
- mv*@spam.guard.caspershouse.com

"Robert Jordan" <ro*****@gmx.net> wrote in message
news:ck*************@news.t-online.com...
sunnyz wrote:
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 {
}
}

Nov 16 '05 #3
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

Nov 16 '05 #4
Nicholas Paldino [.NET/C# MVP] wrote:
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
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sunnyz | last post by:
i am using property in Webservice.But attribute doesn' work for properties.Cud any1 tell me plz which attribute to use for properties thx *-----------------------* Posted at:...
5
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
0
by: kejeiri | last post by:
I wish just to draw the attention to the fact, that my MyClass1...and MyClassN are declared "Serializable"... But, I never get my classes methods, I get just attributes (Or methods Properties)...
6
by: rlcavebmg | last post by:
I am new to Web Services and .NET development, and I have a question. I am writing a service that will create a bitmap image and return it to the client. First, I wrote a method that looked like...
2
by: svendtofte | last post by:
Hello, I've used wsdl.exe, to generate stub code for a WS at work. an example of the stub code is: ========================== /// <remarks/> public abstract class NavigatePublicationTarget :...
0
by: jjouett | last post by:
I'm defining a C# WebMethod where the argument has properties that are mandatory: public bool PerformTask(SimpleObject simpleObject) { .... } where SimpleObject is as follows:
2
by: archana | last post by:
Hi all, I am having one confusion regarding webmethod's fire and forget behaviour. Say suppose i have method like public void StartStatsCrunch() {
0
by: vinay | last post by:
Hi All, I have a requirement to read a cookie and update its value in a webmethod. This webmethod is located in the code behind of an aspx page(used for partial page udpates). I have added the...
2
by: Nathan Sokalski | last post by:
I am attempting to create icons for controls I have created using VB.NET by using the System.Drawing.ToolboxBitmap attribute. I have managed to do this in C# by specifying the path to the *.ico...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.