473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_GetM yClass()
{
MyClass mc = new MyClass();
mc.id = 1; // id must be public
mc.name = "foo";
}

void WebService_Upda teMyClass(MyCla ss mc)
{
// ...
}

WebService client:

MyClass mc = WS.WebService_G etMyClass();
mc.id = 22; // <== this is what I want to avoid *******
WS.WebService_U pdateMyClass(mc );
Thanks for your answers.
Sep 10 '06 #1
1 1622
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_GetM yClass()
{
MyClass mc = new MyClass();
mc.id = 1; // id must be public
mc.name = "foo";
}
void WebService_Upda teMyClass(MyCla ss mc)
{
// ...
}
WebService client:

MyClass mc = WS.WebService_G etMyClass();
mc.id = 22; // <== this is what I want to avoid *******
WS.WebService_U pdateMyClass(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********@joer gjooss.de
Sep 19 '06 #2

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

Similar topics

2
3270
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 interface where people at my company (operators) can enter data for service calls. All data entered is run thru one or more PHP scripts for error checking...
6
1831
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 (i.e. when the database closes, then the number in the table is decremented. I plan to use this on a front/back end setup, with a number of front end...
19
2769
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 create a button that will email the same message (and idealy a word attachment) to whatever address is in view on the form (chances are that I just...
2
1588
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 good control over the install. I have (probably?) prevented unauthorised distribution thus: I have a module which checks the HD partition...
9
4150
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 verbaige completely wrong, but here goes nothing ... I'm currently using the MS Data Access Block for a desktop application I'm writing. Recently, I...
3
2649
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 on the subject? (and yes, I have already googled it at length, but still no strong decision) ============= After a long stint of pure-desktop /...
10
2084
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 Security # or on Last Name. I've created two different tables with the following fields in each table: ClientInfo Client# (primary key) First...
10
2208
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 correct type? Thanks, Andy
1
313
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 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...
9
2154
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) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.