いくつかのXSDがサンプルxmlとともに私に提供されました。 1つのサンプルXMLの抜粋は以下のとおりです。svcutilを使用してdatacontractを生成します。どのように属性を処理するのですか?
<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のは非常に複雑です。次のように
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.
生成のDataContractは次のとおりです:次の形式のすべての ..エラーのsvcutil.exe数が生成された使用datacontractsを生成するには
[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を設定する? アイデア/ヒント/ヒントをお寄せいただきありがとうございます。あなたがする必要がある
フィオナ
ありがとうペトル。私は今、エラーがない:) – Fiona