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 494819
In Process

The Archive Base Latest Questions

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

Is it possible to set a requirement in WCF that a specific string datamember

  • 0

Is it possible to set a requirement in WCF that a specific string datamember have a maximum length?

I’m essentially wanting to do some basic validation, and enhancing the implicit documentation that WSDL gives you.

I’m pretty sure that its possible when writing raw WSDL, but am not sure if you can do it in WCF using attributes etc.

And related, require that an array property have at least one element in it…

  • 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:32:04+00:00Added an answer on May 13, 2026 at 5:32 am

    No, to my knowledge, that’s not possible – at least not yet. There is that concept of Data annotations floating around, being supported by ASP.NET dynamic data and now also by the Silverlight RIA Services, but in “pure” WCF, I don’t know of any such means of limiting the length of a string in your DataContract, or requiring an array to have at least one members.

    At least not in a declarative way (i.e. with attributes on your data contract).

    There are a few things you can do on the data contract, like require an attribute to be present and such, but those are very limited in scope.

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

Sidebar

Related Questions

Is it possible to set the maximum number of open files to some infinite
Is it possible to set some image as title of Navigation bar? I think
If you have a complex requirement set with many users(&servers) how will your websocket
I have a requirement within the same web application to set 2 session timeouts.
I have a set of classes that I've written in C++ for a code
I have a webpage that implements a set of tabs each showing different content.
Background: We have a ClickOnce-deployed WPF app, that talks to WCF Services, which in
I have a requirement wherein I have huge set of information in a NSArray
I have a requirement to do the following. Pass a set of variables from
What are some possible designs to deal with frequently changing data forms? I have

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.