olduğunda C#, .NET 4.5, Konsol uygulaması kullanıyorum. Servis referansında WSDL dosyasını ekledim. XSD dosyası gibi doğrulama kuralları detayları ile de bulunmaktadırXSD ile XML doğrulaması, doğrulama kurallarının bir kısmı WSDL
<xs:complexType name="xRequest">
<xs:sequence>
<xs:element name="SenderDateTime" type="ip:grDateTime"/>
<xs:element name="SenderId" type="ip:grIdentifier"/>
</xs:sequence>
</xs:complexType>
: gibi WSDL İçinde doğrulama kurallardır
<xs:simpleType name="grDateTime">
<xs:restriction base="xs:dateTime">
<xs:pattern value="[0-9]{4,4}\-[0-9]{2,2}\-[0-9]{2,2}[T][0-9]{2,2}:[0-9]{2,2}:[0-9]{2,2}(\.[0-9]{1,6}){0,1}"/>
</xs:restriction>
</xs:simpleType>
Ve otomatik gibi Reference.cs içinde WSDL özelliklerini yarattı:
public partial class xRequest
{
private string senderIdField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public string SenderId {
get {
return this.senderIdField;
}
set {
this.senderIdField = value;
this.RaisePropertyChanged("SenderId");
}
}
}
xRequest nesnesini XML'ye serileştiriyorum ve doğrulamak istiyorum. Doğrulama kurallarının bir kısmı WSDL'de olduğunda, XML'i nasıl XSD ile doğrulayabilirim?