Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Show us your classes that are being sent back as response from your WCF service! Without them, it's at best a guessing game....</p> <p>You can put certain DataContract-related attributes on properties to include or exclude them from the serialization process in WCF.</p> <p>Basically, with WCF in .NET 3.5 SP1, you don't <em>have to</em> specifically label your classes and their properties with special attributes anymore. If you don't, the DataContract serializer will act like the XML serializer : all public properties are being serialized.</p> <p>If you don't want to include certain properties in the serialization, you don't really have a choice but to </p> <ul> <li>put the <code>[DataContract]</code> attribute on your classes, and</li> <li>put the <code>[DataMember]</code> attribute on your fields and properties that you do want to be serialized</li> </ul> <p>Anything you do not adorn with a [DataMember] attribute will then be skipped and not included in the WCF response message.</p> <p>So in your case, you would have to do something like</p> <pre><code>[DataContract] class GetCertMailReceiptNumbersResult { // no DataMember attribute --&gt; will not be included! int AccountNumber {get;set;} string Address1 {get;set;} ...... string Password {get;set;} // here, include DataMember attributes --&gt; will be included [DataMember] int ReturnCode {get;set;} [DataMember] string ReturnMessage {get;set;} // and so forth } </code></pre> <p>Basically, for each type in your WCF service, you need to make a decision which fields and properties to include - mark those with the <code>[DataMember]</code> attribute. Anything else will <em>not</em> be included in your serialized message.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload