Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 495581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:36:25+00:00 2026-05-13T05:36:25+00:00

I have a class with a Property : [DataMember] public bool MyProp { get;

  • 0

I have a class with a Property :

[DataMember]
public bool MyProp { get; internal set;}

I notice that when the proxy is generated. The property is still settable even though I have marked it internal ( I thought that it won’t be generated at all ).

Is there a way to achieve what I’m trying? I’d like to be able to set the property from the service side. But not allow the client side to be able to set the property.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:36:25+00:00Added an answer on May 13, 2026 at 5:36 am

    A [DataMember] on a WCF contract is just a data field on a data contract – an XML schema. The .NET setter and getter visibility modifier are irrelevant when dealing with WCF messages, really.

    If your field has a [DataMember] attribute, it will be part of the XML schema of your data contract – and the client cannot know that it has an “internal” setter on the server side – it’s just part of the XSD data contract.

    .NET and WCF are two very distinct and separate worlds – when your client calls a WCF service, it’s a SOAP-based message passing only – there’s no .NET based object interaction! You’re not reaching out from your client to the server to call a method on an object on the server side – in which case maybe a .NET visibility specifier would come into play. Your client creates a messages and sends that to the server, which then reassembles the (server-side) object from that message – heck, there’s even a SMTP (e-mail!) based transport for WCF!

    The only thing the two sides share are contracts – service/operation contracts for your service methods, and XML schema based data contracts for your data being passed around. There’ no concept of .NET based visibility specifications in XML schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class with internal property: internal virtual StateEnum EnrolmentState { get { ..getter
I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I
I want to have a class property that allow for an expression to take
D2.0 classes have a __monitor class property that gives access to the class object's
I have a class with a property marked with [XmlText] , that accepts multiline
Just imagine you have the following class [DataContract] public class NamedList { [DataMember] public
Basically if I have the following: [DataContract] public class Foo { [MyCustomAttribute(...)] [DataMember(IsRequired =
I have a public class that won't serialize properly. When attempted, the following exception
I have a simple object: [DataContract] public class MyClass { [DataMember(Name = MyClassNo)] public
I have a class in WCF: [DataContract] public class Usuario { [DataMember] public int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.