I want to create / infer schema for data-contract serialized classes.
When I use [DataContract(IsReference = true)]
attribute the serializer is injecting attributes z:Id="i2"
and z:Ref="i2"
to reference the same object instances.
Both attributes are from http://schemas.microsoft.com/2003/10/Serialization/
namespace.
Questions:
- Is there a xsd schema file for the namespace used by serializer which I could import into my schema?
- For now I am defining those attributes as a
xs:ID
/xs:IDREF
pair. Is that correct?
Thanks in advance.
The xsd schema is supposed to described here - look for the section Data Contract Serialization Schema. However, if you do look for your attributes, you will not find them in there - documentation bug!
To get the full schema, take a look at this and this - inside the WSDL types, you'll find the correct schema. As for your assumption regarding the attributes, yes, you are correct.
I am inlining it here, just in case: