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

Limiting access to fields for web service client

dev
Hello,

I have a web service that returns an entity (C# class). I would like to
disallow access to some of the members in write access to the WebService
clients. Setting them private or protected in the class definition can
not be achieved since in the WebService they must be writeable.

Dummy example to explain if it is not clear:

In WebService definition:

// ...
class MyClass
{
public int id;
public int name;
};

// ...
MyClass WebService_GetMyClass()
{
MyClass mc = new MyClass();
mc.id = 1; // id must be public
mc.name = "foo";
}

void WebService_UpdateMyClass(MyClass mc)
{
// ...
}

WebService client:

MyClass mc = WS.WebService_GetMyClass();
mc.id = 22; // <== this is what I want to avoid *******
WS.WebService_UpdateMyClass(mc);
Thanks for your answers.
Sep 10 '06 #1
1 1610
Thus wrote Dev,
Hello,

I have a web service that returns an entity (C# class). I would like
to disallow access to some of the members in write access to the
WebService clients. Setting them private or protected in the class
definition can not be achieved since in the WebService they must be
writeable.

Dummy example to explain if it is not clear:

In WebService definition:

// ...
class MyClass
{
public int id;
public int name;
};
// ...
MyClass WebService_GetMyClass()
{
MyClass mc = new MyClass();
mc.id = 1; // id must be public
mc.name = "foo";
}
void WebService_UpdateMyClass(MyClass mc)
{
// ...
}
WebService client:

MyClass mc = WS.WebService_GetMyClass();
mc.id = 22; // <== this is what I want to avoid *******
WS.WebService_UpdateMyClass(mc);
Thanks for your answers.
The overall model of transmitting an object across process boundaries while
still trying to maintain control over is dangerously flawed. Web Services
are all about exchaging messages. If you don't want to make information visible
on the receiver's side, don't put that information in your message.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Sep 19 '06 #2

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

Similar topics

2
by: Jay Moore | last post by:
Greetings, all! I have a project for work, and I'm not sure how to efficiently do what I need to do. I'm hoping someone out there can help. Project is this: I'm creating a web-based...
6
by: Gerry Abbott | last post by:
Hi all, Have written some code to limit the concurrent users of a database. Use the Autoexec macro to open a form. When the form opens it increments a value in a table. When the form closes...
19
by: Bill | last post by:
I have searched through the posts for a question like mine but have only found much more complicated responses. On single record view of a form I have an email address field. I merely want to...
2
by: Jo Davis | last post by:
access fe and access be. later the be might be sql server I don't want people to pass this application around. And I want control over usage. I want it to 'expire' after a while. I have fairly...
9
by: Clint | last post by:
Hey all - Excuse the cross-post ... I'm not sure what the appropriate newsgroup would be for this question. I have a question that I'm not quite sure how to ask. For all I know, I have the...
3
by: Marc Gravell | last post by:
Kind of an open question on best-practice for smart-client design. I'd really appreciate anyones views (preferably with reasoning, but I'll take what I get...). Or if anybody has any useful links...
10
by: Robert | last post by:
I am an attorney in a non-profit organization and a self-taught programmer. I'm trying to create a client db that will allow me to search for potential conflicts of interest based either on Social...
10
by: Andy Kendall | last post by:
I have a problem accessing my custom SoapHeader from a SoapExtension. My extension has no compile time reference to the class derived from SoapHeader, so how can cast it into a SoapHeader of the...
1
by: dev | last post by:
Hello, I have a web service that returns an entity (C# class). I would like to disallow access to some of the members in write access to the WebService clients. Setting them private or...
9
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.