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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:10:17+00:00 2026-05-15T19:10:17+00:00

lHi, I’m currently writing a WCF service. One of those methods get’s a request

  • 0

lHi,

I’m currently writing a WCF service.
One of those methods get’s a request object and returns a response object. In the request there are a couple of value-type members.

Is there a way to define members are mandatory in the declarative way?
I’m in an early stage of development and I don’t want to start with versioning now. In addition I don’t want to have method sig with 25 parameters, therefore I created the request object.

The problem I have is that due to the value-types, I can never be sure if the consumer of the service intended to have the default value in there, or it was just by lazyness.
On consumer side you don’t easily detect that you probably missed that property.

So I would like to have something that forces the caller of the service to provide an value, and if not he ideally get’s a compile-time error.

any ideas?

tia,
Martin

  • 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-15T19:10:17+00:00Added an answer on May 15, 2026 at 7:10 pm

    Please check if the following is resolving your issue:

    IsRequired/EmitDefaultValue Attribute on DataMember

    http://social.msdn.microsoft.com/forums/en-US/wcf/thread/d9e45449-cc50-42e2-b955-75ab86f01d4f

    The topic above describes a combination of
    IsRequired and EmitDefaultValue attributes set on a request member, which according to the discussion there at least seams to resolve the “issue”

    cheers

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

Sidebar

Related Questions

I'm playing with timezones in MySQL. I need to assign people to timezones, and
I can write a function this way in Objective-C. This can be used to
I have a few questions in trying to understand different encodings. What is the
window[objref] does not work self[objref] does not work either Here is jsfiddle . Here
I'm working on a module which uses a shared library, which in turn has
I'm trying to have a connection between a Java server and a C++ client.
I'm using for-loops to iterate over two-dimensional list: def itr(lpic, lH, lW, x, y):
I have a table that has 4 rows, the first to ID them, and
Why does the following code NOT give an error, nor any type of a
The MSDN article just says: Return Value S_OK on success, or any standard HRESULT

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.