I have to call a Web Service, that in the request, has a property like this:
[System.Xml.Serialization.XmlElementAttribute("Criteria", typeof(QueryTypeCriteria), Order=2)]
[System.Xml.Serialization.XmlElementAttribute("Identification", typeof(BaseComponentType), Order=2)]
[System.Xml.Serialization.XmlElementAttribute("SortExpression", typeof(SortExpressionType), Order=2)]
public object[] Items {
get {
return this.itemsField;
}
set {
this.itemsField = value;
this.RaisePropertyChanged("Items");
}
}
After build the request, when I invoke the Web Service, I receive the following error:
The type QueryTypeCriteria was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
I read that this is related to XmlSerializer, but this is a WCF client generated by Visual Studio. What can I do?