Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Serialization Programming Model for WCF  Similar to ISerializable (also supported by WCF)  Can generate from/to WSDL/XSD using svctool  Example:

Similar presentations


Presentation on theme: " Serialization Programming Model for WCF  Similar to ISerializable (also supported by WCF)  Can generate from/to WSDL/XSD using svctool  Example:"— Presentation transcript:

1

2  Serialization Programming Model for WCF  Similar to ISerializable (also supported by WCF)  Can generate from/to WSDL/XSD using svctool  Example:  [DataContract] public class ComplexDataContract { [DataMember] string name; [DataMember] System.Version version; [DataMember] System.IO.FileInfo fileInfo; [DataMember] System.Collections.Generic.List uriList; [DataMember] System.Data.SqlTypes.SqlInt32 sqlInt; [DataMember] System.Drawing.KnownColor knownColor; }

3  xs:import references a namespace, but also a physical document  Namespaces in.NET assembly are not bound to the physical document or XML namespace.  Import parent XSD then import chiid XSD. Duplicate types created.

4  SvcTool parameter /references:  Allows parent assemblies to be referenced  Searches for duplicate types  “Custom Tool” for Visual Studio  Generates code when XSD is edited  Integrates with project system

5  SvcTool is limited:  Only supports basic types in parent element/type ▪ boolean, byte, dateTime, decimal, double, float, int, long, short, unsignedByte, unsignedInt, unsignedLong, unsignedShort ▪ Critical: Fails if xs:string is included  Option B:  Use XsdDataContractImporter  Would have better performance too


Download ppt " Serialization Programming Model for WCF  Similar to ISerializable (also supported by WCF)  Can generate from/to WSDL/XSD using svctool  Example:"

Similar presentations


Ads by Google