.NET - Is there the attribute [DataContract] for a Web Service?
note that I am not using WCF, i'm only using ASP.NET web service. Anything similar? Thank you. ...
note that I am not using WCF, i'm only using ASP.NET web service. Anything similar? Thank you. ...
Hello, #r@"\.NETFramework\v4.0\Profile\Client\System.Runtime.Serialization.dll" open System.Runtime.Serialization open System.Runtime.Serialization.Json [<DataContract>] type geo = { [<field: DataMember(Name = "type")>] t:string [<field: DataMember(Name = "coordinates")>] coordinates:string }...
Hello Experts, Please can i use datacontracts in WCF for streaming instead of message Contract. If yes, will it offer any performance improvement? THanks ...
My WCF service exports a single operation, marked with the catch-all action and reply action so that it represents a common entry point to the service: [ServiceContract] public interface IService { [OperationContract (Action="*", ReplyAction="*")] Message MyMethod (Message msg); } Client proxies are still generated as data con...
Hi, I have a Data Access Layer, a Service Layer, and a Presentation Layer. The Presentation Layer is ASP.NET MVC2 RTM (web), and the Service Layer is WCF (services). It's all .NET 3.5 SP1. The problem is that in the services, the objects being returned are marked with the [DataContract] attribute. The web is using the AppFabric Cache (...
I've got several data contract classes like this: [DataContract] public class FooData { [DataMember] public string Name; // ... many more members public FooData (string name) // again, many more arguments { Name = name; // ... } } Since FooData is always used to transport Foo objects over the ...
I am going to use Entity Framework and WCF in my application. The suggested practice, as I saw, is using POCO with Entity Framework and also using POCO classes as DataContracts. That is actually what POCO and Attributes are used for, -if I am not wrong. However I am asked to use seperate classses for Entity Framework POCO's and WCF Data...
We're using DataContractSerializer to deserialise XML data coming into a RESTful API written in MVC.Net. I'm trying to send a list of objects into an action method, however the deserialisation always returns null, even when using XML serialised from the same classes. Does anyone have any idea's of why this is happening. Code is below. [...
Having read the documentation and many many articles I believe the following should work but it doesn't. This is how my datacontracts are structured. [DataContract] [KnownType(typeof(Friend))] public class Person { private string name; [DataMember] public string Name { get { return name; } set { name = value; }} private P...
I want to serialize datacontract classes into XMl, but without the Namespaces. I've added: [DataContract(Namespace="")] but I still get: <Person xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Title>Mr</Title> ... </Person> Is there any way to stop this happening as I just want the clean xml to pass into a legacy componen...
I am trying to create a class with a read-only Id field, however I am having problems retaining the value when the object passes through the WCF server. I cannot set the [DataMember] attribute on the public property since there is no set method, and I would like to keep it that way if possible since I do not want this value changed by e...
How would I tell the WCF service what KnownTypes to use when passing data back to the client? I know I can use the [ServiceKnownType] attribute, which makes the service call run fine from a WCF Test Server, however it still fails from the client. Am I missing something here? [OperationContract] [ServiceKnownType(typeof(SubClassA))] [Se...
I am Using WCF service to implement my web-service I have problem when I try to call my function which takes URL as input parameter and returns an object class which was defined by me. public class Service: IService<br> { public ClassWS My_Stores(String URL) { try { //ClassWS is a class which has othe...
I've seen many different ways to serialize objects in C# that I'm not sure which one to use and when. In the current situation I'm serializing for exposure through WCF so I'm guessing the [DataContract] attribute is the way to go. Currently I'm reading in some XML, then exposing the resulting object through WCF. So I am deserializi...
I'm trying to deserialize some xml without having the original class that was used to create the object in xml. The class is called ComOpcClientConfiguration. It's succesfully setting the ServerUrl and ServerUrlHda values, but not rest of them... So what I'm asking is: How can I make the rest of these values get set properly, and why are...
Hi, So I have some class in a business logic .dll. It is not wrapped in a datacontract, I would like to expose it to anything calling the service by doing so in the Service and IService classes (for example). But the only examples I have seen have been to expose classes that are defined in the service, I do not wish to do this and I do ...
I've been trying to get a WCF service to access a file database that is stored on a local file system to no avail currently. I created a database called data.mdf in visual studio 2010 and ran this sql query on it. create table Person (PersonID int identity (1000,1) not null, Name nvarchar(50) not null, Address nvarchar(max...
Made som mock code below to illustrate my example. The problem is the lambda expression. If I leave it as in the code example it will not serialize when I try to call the service. However if I type .ToList() after the lambda it serializes as it should. Why is that? I can't see why the code below should not work... Anyone care to enlight...
I have a WCF service that is causing a bit of a headache. I have tracing enabled, I have an object with a data contract being built and passed in, but I am seeing this error in the log: <TraceData> <DataItem> <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"...
I am having the following data structure: [DataContract] public class OperationResult<T> { public OperationResult() { } [DataMember] public Int32 OpResult { get;set; } [DataMember] public IList<T> OperationResults { get;set; } public static OperationResult<T> Success(IList<T>...