当我们尝试通过代码访问个人资料时,我们收到以下消息,请咨询
错误是:
There was an error in serializing one of the headers in message
EPS_ProfileReadRQRequest: 'Unable to generate a temporary class (result=1).
错误CS0030:无法将类型“ CRM.ProfileReadRQ.BusinessSystemIdentityInfoSynchronizationCriterionTypeExcludeCombination”转换为“ CRM.ProfileReadRQ.BusinessSystemIdentityInfoSynchronizationCriterionTypeIncludeCombination” 错误CS0029:无法将类型'CRM.ProfileReadRQ.BusinessSystemIdentityInfoSynchronizationCriterionTypeIncludeCombination'隐式转换为'CRM.ProfileReadRQ.BusinessSystemIdentityInfoSynchronizationCriterionTypeExcludeCombination'
答案 0 :(得分:0)
之所以发生这种情况,是因为串行器不知道要转换为哪种类型,因为引发错误的类型可能不止一种类型。我认为这简化了XML,但使WSDL / .NET的内容更加复杂。我可能并不是说的很准确,但这是要点,至少据我了解。
您可以进入reference.cs文件,并删除那些有问题的字段的序列化,然后重试。过去,我已经取得了一些成功。但是,如果/当您使用新的WSDL文件更新API版本时,则必须记住再次进行此操作,因此,这不是一个完美的解决方案。我已经从我的reference.cs文件中删除了一个样本,以获取下面的配置文件API之一,希望对您有所帮助。
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.sabre.com/eps/schemas")]
public partial class BusinessSystemIdentityInfoSynchronizationCriterionType {
private BusinessSystemIdentityInfoSynchronizationCriterionTypeExcludeCombination[] itemsField;
private ItemsChoiceType1[] itemsElementNameField;
//remarked this out 12/24/18 - these include/exclude combinations do not serialize correctly for some reason
/// <remarks/>
//[System.Xml.Serialization.XmlElementAttribute("ExcludeCombination", typeof(BusinessSystemIdentityInfoSynchronizationCriterionTypeExcludeCombination))]
//[System.Xml.Serialization.XmlElementAttribute("IncludeCombination", typeof(BusinessSystemIdentityInfoSynchronizationCriterionTypeIncludeCombination))]
//[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
//public BusinessSystemIdentityInfoSynchronizationCriterionTypeExcludeCombination[] Items {
// get {
// return this.itemsField;
// }
// set {
// this.itemsField = value;
// }
//}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("ItemsElementName")]
[System.Xml.Serialization.XmlIgnoreAttribute()]
public ItemsChoiceType1[] ItemsElementName {
get {
return this.itemsElementNameField;
}
set {
this.itemsElementNameField = value;
}
}
}