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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:08:58+00:00 2026-05-24T21:08:58+00:00

could some one please confirm whether I should always have a DataContract and datamember

  • 0

could some one please confirm whether I should always have a DataContract and datamember attribute for Operation Parameter and return types?
e.g.

ResponseMessage getOrderDetails(RequestMessage msg)
{
  ....
}


public class ResponseMessage
{
  ...
}


public class RequestMessage
{
  ...
}
  • 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-24T21:09:00+00:00Added an answer on May 24, 2026 at 9:09 pm

    The parameter types and return types need to be either serializable or treated in a special way by WCF.

    For the first case, [DataContract] and [DataMember] is only one way to make a type serializable – the post at http://blogs.msdn.com/b/sowmy/archive/2006/02/22/536747.aspx describes the serialization programming model in WCF. As Ladislav mentioned, starting with .NET 3.5 SP1 WCF introduced a default (POCO) serialization so you don’t need any annotation at all.

    For the second case, there are some types which are treated as special cases by WCF, such as System.IO.Stream or System.ServiceModel.Channels.Message – and you can even add more such types if you use a custom message formatter (although this is an advanced scenario and not very common).

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

Sidebar

Related Questions

Could some one please help me out on this I have the following json
Could some one please let me know whether there is any way where in
Could some one please help me understand when to use SNAPSHOT isolation level over
Could some one please tell me how do we use the text function with
Could some one please explain the advantages and disadvantages of using the new MVC2
Could some one please show me how I can rewrite the below method in
could some one please explain this snippet of magento code found in loadByCustomerId() in
Could someone please be kind enough to confirm if I have understood the Async
Could some one please explain, What happens when a reference type is defined inside
Hi could some one please take a look at this and let me know

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.