開始開發WCF-WPF應用程序。Catel ModelBase PropertyData反序列化
客戶端和服務器之間的數據在消息級別被加密。 根據角色和用戶名和密碼,使用自己的策略實施自定義身份驗證和授權。
面對一個奇怪的錯誤。 如果簡單類型或類型實現在客戶端和服務器之間傳輸的[DataContract],則該應用程序可以工作。 但是,當我嘗試傳輸包含Catel庫的PropertyData的項目。 獲取異常 System.Security.Cryptography.CryptographicException:(DigestVerificationFailedForReference)測試鏈接「#_0 \」的失敗摘要。 「
的app.config
<serviceCredentials>
<serviceCertificate findValue="01" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySerialNumber" />
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="TS.PortraitExpertise.AuthWCF.CustomUserNameValidator, TS.PortraitExpertise.AuthWCF" />
</serviceCredentials>
模型excample
[Serializable]
public class TestModel : ModelBase
{
public TestModel()
{
}
protected TestModel(SerializationInfo info, StreamingContext context)
: base(info, context) { }
/// <summary>
/// Unique key.
/// </summary>
public int Id
{
get { return GetValue<int>(IdProperty); }
set { SetValue(IdProperty, value); }
}
/// <summary>
/// Register the Id property so it is known in the class.
/// </summary>
public static readonly PropertyData IdProperty = RegisterProperty("Id", typeof(int));
}
如果在消息級別禁用加密,該數據被正常地發送。如果你只是序列化對象,然後反序列化,操作正常完成 如果在序列化和反序列化模型之間播放問題Katel加了加密 如何解決問題不放棄模型Catel?
如果您在問題跟蹤器上創建官方故障單,我會研究它:http://www.catelproject.com/support/issue-tracker/ –
非常感謝您幫助創建問題CTL-308 – bobah75