Last post Jan 09, 2014 02:43 AM by kaushalparik27
Jan 09, 2014 12:04 AM|vikram shah|LINK
wcf service running without datacontract, is it possible?
Jan 09, 2014 12:25 AM|akhilrajau|LINK
you asking datacontract attribute? No specfically need. But if you don't use you need to control the serialization
Check the below links
Jan 09, 2014 12:29 AM|kaushalparik27|LINK
I guess you are talking about
DataMember attrubutes. Event if you dont add these attributes within your DataContract class in WCF; it will still work and will use default serializer. But, it will lose some of capabilities:
When to use DataContract and DataMember attributes? Here is another discussion you might be interested on same topic.
Is DataContract attributes required for WCF
hope it helps./.
Jan 09, 2014 01:03 AM|vikram shah|LINK
I am able to create and consume service witout datacontract , so in what specifice cases (practical approach) is it beneficial.
You metoined about serialization, that means in disparate environment of cosuming services I won't be able to use it,
Please throw some more light.
Jan 09, 2014 01:08 AM|akhilrajau|LINK
I think the below thread helps to find out the benefits
Jan 09, 2014 01:22 AM|kaushalparik27|LINK
that means in disparate environment of cosuming services I won't be able to use it,
In separate invironment, yes you can still consume service and pass-receive data by marking the class as [Serializable]
Jan 09, 2014 01:46 AM|vikram shah|LINK
to consume services say in java environment, we have to use datacontract decorating, but if we are using the same environemnt i.e., dot net then the datacontract attribute is not required is this what we can infer from the above links and threads. My concern
was that service was accessible without datacontract. But in case of serialization I remember we are not able to access the service even in the same envorionment without using serialization attribtue
Jan 09, 2014 01:55 AM|kaushalparik27|LINK
To be in same environment or not, to be clear here: in any case if you don't use DataContract and DataMember attribute; I believe it will work but then instead you will have to use [Serializable]
Jan 09, 2014 02:14 AM|vikram shah|LINK
in any case if you don't use DataContract and DataMember attribute; I believe it will work but then instead you will have to use [Serializable]
Its working even without using [Serializable] attribute.
Jan 09, 2014 02:43 AM|kaushalparik27|LINK
I guess then it might defaults to acting like a field-serializer as per
this thread But, practically I don't see any benefits in not annotating the required classes with Serializable or DataContract/DataMember.