473,406 Members | 2,620 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,406 software developers and data experts.

apply Attribute to return value

Hi,

For a problem I'm having a solution could be to apply the SoapAttributeAttribute
to the return value of my method. The documentation says it's possible, even the
errormessage I'm getting ("Attribute 'SoapAttribute' is not valid on this declaration type.
It is valid on 'property, field, param, return' declarations only") says so.

So the question is: *how* can I specify this attribute for a return value (or parameter)?
(I know how to do it for a property or field).

BYW, I got the errormessage (from the compiler) when I specified that attribute
before the method, as in:
[SoapAttribute]
public MyObject MyMethod() ...

Hans Kesting
Nov 17 '05 #1
2 2025
Hans,
So the question is: *how* can I specify this attribute for a return value (or parameter)?
(I know how to do it for a property or field).

BYW, I got the errormessage (from the compiler) when I specified that attribute
before the method, as in:
[SoapAttribute]
public MyObject MyMethod() ...

[return: SoapAttribute]
public MyObject MyMethod() ...
Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 17 '05 #2
Mattias Sjögren wrote:
Hans,
So the question is: *how* can I specify this attribute for a return
value (or parameter)? (I know how to do it for a property or field).

BYW, I got the errormessage (from the compiler) when I specified
that attribute
before the method, as in:
[SoapAttribute]
public MyObject MyMethod() ...

[return: SoapAttribute]
public MyObject MyMethod() ...
Mattias


Thanks, that compiles. It's well hidden in the documentation (MSDN),
I've finally found it in the language specs (part 17.2).

Now I need to see if this solves my original problem ...

Hans Kesting
Nov 17 '05 #3

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

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
1
by: Thomas Heller | last post by:
I have a subclassable type implemented in C, which has a 'value' attribute implemented in the tp_getset slot. The type is named c_long. The value attribute accepts and returns integers. Now I...
3
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
2
by: spolsky | last post by:
it is possible by dom(scripting) to apply multiple classes to the className attribute. elmRef.className = 'Class1 Class2 ...' ; but what if some other script assigns its own classes. in this...
4
by: Matt Kruse | last post by:
According to standards, if an option is selected and it has no VALUE attribute, the contents of the option tag is to be submitted. So: <select name="sel"> <option selected>Value</option>...
3
by: Eric Mahurin | last post by:
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of...
4
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have assigned an existing object to propertygrid.selectedobject property. But I only want some of the object's properties not browsable and/or readonly. How can I do that? I'm trying to find...
6
by: Adam Donahue | last post by:
As an exercise I'm attempting to write a metaclass that causes an exception to be thrown whenever a user tries to access 'attributes' (in the traditional sense) via a direct reference. Consider:...
6
by: Tony Johansson | last post by:
Hello! Here I have a simple example of a custom defined Attribute class called CodeStatus. Now to my question when I debug this application and I set a breakpoint in the CodeStatus attribute...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.