Ряд XSD были предоставлены мне вместе с образцом xml.Фрагмент одного образца XML:
<tfsChequeId xmlns="http://www.something.com/XMLSchemas/itrs/tfs/v1">
<dic numericCode="20010411199194813505"/>
</tfsChequeId>
XSD для этого фрагмента выглядит следующим образом:
<xsd:element name="tfsChequeId" type="tfs:TfsChequeId" minOccurs="1" maxOccurs="1" />
<xsd:complexType name="TfsChequeId">
<xsd:sequence>
<xsd:element name="dic" type="tfs:TfsChequeIdDic" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The Document Identity Code (Doc-ID Code / DIC) is the representation of the document identity as printed on the document (usually also as barcode).
In many cases it also contains additional information for the form (refund rule, check digit, etc.). Several variants of the document identity code exist, but
they all contain at least the information that is included in the document identity number (country, store and serial number).
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TfsChequeIdDic">
<xsd:attribute name="numericCode" type="common:DocumentIdentifierCode">
<xsd:annotation>
<xsd:documentation>The document identity code is the representation of the document identity as printed on the document (usually also as barcode).
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
XSD довольно сложны.При создании контрактов данных с использованием svcutil.exe было сгенерировано несколько ошибок. Все следующие формы:
Error: There was a validation error in the schemas provided for code generation:
Source:
Line: 85 Column: 6
Validation Error: Type 'http://www.something.com/XMLSchemas/itrs/common/v1:Docu
mentIdentifierCode' is not declared, or is not a simple type.
Генерируемый контракт данных выглядит следующим образом:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="TfsChequeId", Namespace="http://www.something.com/XMLSchemas/itrs/tfs/v1")]
public partial class TfsChequeId : object, System.Runtime.Serialization.IExtensibleDataObject
{
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private www.something.com.XMLSchemas.itrs.tfs.v1.TfsChequeIdDic dicField;
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
{
return this.extensionDataField;
}
set
{
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
public www.something.com.XMLSchemas.itrs.tfs.v1.TfsChequeIdDic dic
{
get
{
return this.dicField;
}
set
{
this.dicField = value;
}
}
}
Однако я 'не знаю, как использовать это .. т.е. установить numericCode?Любые идеи / советы / советы будут с благодарностью приняты.
Фиона