作者:dfpkgih | 来源:互联网 | 2023-02-04 19:42
我使用C#,.NET 4.5,控制台应用程序.我在服务引用中添加了WSDL文件.内部WSDL是验证规则,如:
还有XSD文件,验证规则的详细信息如下:
我在Reference.cs中自动生成了WSDL的属性,如:
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对象序列化为XML,我想验证它.当部分验证规则在WSDL中时,如何使用XSD验证XML?