Questions tagged [datacontracts]
36 questions
1
vote
1 answer
iterate through list
I'm having some difficulty in iterating through a datatable and assigning each value to a given property in a datacontract list.
So I have the following DataContract:
namespace Shared.DataContracts
{
[Serializable]
[DataContract(Name =…

Christian Kellermann
- 27
- 1
- 4
1
vote
0 answers
How to get a JSON object from a DataContract .NET with dynamic names
I have the following object:
[DataContract]
public class A
{
[DataMember]
Dictionary B {get; set;}
}
With the default serialization using DataContractJsonSerializer I get the following JSON
{ B :…

IgrCndd
- 53
- 4
1
vote
1 answer
what is the use of [Datacontract] attribute in entity class of WCF
I am using .net 4.0 and wcf service. I have business entity classes which is not defined with [Datacontract] attribute.
When I try to retrieve less than 1000 records of type business entity class it works fine
but when I try retrieving more than…

subash
- 4,050
- 14
- 51
- 78
0
votes
0 answers
A strategy to add more datacontracts/DTOs to a WCF Service without recompiling the Service Project/Solution
I am currently developing a WCF service that will evolve over time to include new DTOs. I am currently using MEF withing the service implementation to export the webservice object. I have the WCF service project and the datacontracts' project within…

OraKLE
- 1
- 1
0
votes
1 answer
Define members that must be attributes into the data contract
Ok, I'm sure this must be terribly easy, but I cannot find info into the matter.
Also, it's my first time using WCF, so get easy on me if I'm a bit slow understanding things.
Let's say I have this class
[DataContract]
public class whatever {
…

Bardo
- 2,470
- 2
- 24
- 42
0
votes
1 answer
WCF - Using [MessageContract] without [MessageHeader]
The question is pretty straightforward. Is there any sense to use [MessageContract] attribute instead of [DataContract] if we're not using [MessageHeader] attrribute, but only [MessageBodyMember]. In that case it will be the same to use…

Piotr Czarnecki
- 1,688
- 3
- 14
- 22
0
votes
1 answer
Share Json data between Asp.Net MVC 2 and Asp.Net server side C# code?
I created and love my Asp.Net MVC2 application. It's a very nice DDD app with Domain Model classes, View Model classes, a repository, and Json action methods to expose data.
My coworker wants to share my data with his Asp.Net Forms based C# code. …

Zachary Scott
- 20,968
- 35
- 123
- 205
0
votes
1 answer
How to allow new clients to access only few methods in WCF?
I have WCF service with 5 operation contracts. Say 200 users using this service.
Now new 50 clients want only 3 operations from this WCF service.
How do I restrict them to use only 3 and block other 2 operations ?

James
- 1
0
votes
1 answer
DataContractSerializer KnownType attribute not being respected?
I have a class that is decorated with a KnownType attribute with a type of the class. Is this not allowed?
[KnownType(typeof(Occ600UIConfig))]
public class Occ600UIConfig
{ }
If so, why is the DCS throwing the following…

Klaus Nji
- 18,107
- 29
- 105
- 185
0
votes
3 answers
Which types cannot be used for WCF?
I know for a matter of fact that Type cannot be used when passing in to a WCF service. Does anyone have a complete list?

chugh97
- 9,602
- 25
- 89
- 136
0
votes
3 answers
Business enum to DatContract Enum conversion in WCF
I have an enum
namespace Business
{
public enum Color
{
Red,Green,Blue
}
}
namespace DataContract
{
[DataContract]
public enum Color
{
[EnumMember]
Red,
[EnumMember]
Green,
…

chugh97
- 9,602
- 25
- 89
- 136
0
votes
2 answers
Property of type List
I'm developing a WCF with two Classes as DataContracts. One of them is a Data Structure developed by myself which manages Objects as JSON one, it names JSON; the other is just a Customized Object that my WebService recieve, it names Emission. I have…

user3018905
- 1
- 1
- 1
0
votes
1 answer
Why is my JSon giving me nulls on sub-arrays?
I've been having a ghastly time trying to get an incoming Json message to serialize (and deserialize correctly). First is the incoming Json that I'm posting to our MVC rest service via POSTMAN. Validated it through JsonLint. The main problem is…

Helmut S
- 3
- 2
0
votes
1 answer
WCF Business Objects or DataContracts
I have three projects:
WCF Service project (Interface and Implementation)
aspx web project (client) that consumes the WCF Service
class library project that holds my business objects (shared by both WCF project and client)
I have a method in…

alpha
- 501
- 2
- 7
- 22
0
votes
2 answers
Shared DataContract Worker Role / Web Role
I have an Azure Web Role linked to a Worker Role via an internal endpoint for the purpose of using the worker role to serve up data to the web role, maintaining isolation between the web-role and the database [which contains sensitive data]. There…

Grant Roy
- 46
- 1
- 1
- 9