views:

21

answers:

1

Hi, I am adding a WCF Service Reference in a Silverlight project, it is generating code with XmlSerialization attributes for DataMembers than SOAP Serialization. But, if the same WCF service reference is added in an ASP.Net project, is generating code with SOAP Serialization attribtues. Can anybody let me know what could be the cause for it, and how can I force reference to generate SOAP Serialization? XmlSerialization - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")] SOAP Serialization - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] These are the attributes in the code generated for types, which I am looking into when saying it is using XmlSerialization/SOAP Serialization

A: 

Found out the reason for the behavior. One of the methods in the WCF Services is returning DataSet as the result. Since Silverlight does not support direct ADO.Net object, the proxy generator tool for Silverlight is forcing it to generate XmlSerialization attributes than SOAP Serialization attribute.

Shravan
Other option with this is using direct SlSvcUtil.exe for generating the proxy, and giving reference to System.Data.dll with the /reference switch, and also forcing to use DataContractSerializer with the /serializer switch.
Shravan