我的服务有一个像这样的 EncryptedClient
_jsonClient = new JsonServiceClient(baseUrl);
string publicKeyXml = _jsonClient.Get(new GetPublicKey());
_encryptedCient = _jsonClient.GetEncryptedClient(publicKeyXml);
_encryptedCient.SessionId = authResponse.SessionId;
和 DTO
public class AlarmNotification : IReturnVoid, IHasSessionId
{
public string SessionId { get; set; }
}
当我调用时,服务中的处理程序方法并不重要
_encryptedCient.Send(new AlarmNotification { });
它到达服务器,请求被正确处理,但在服务完成处理后,我得到 ArgumentNullException,指出某个名为“s”的字符串引用了 null。如果我使用除 IReturnVoid 之外的任何其他返回类型,一切都会正常。欢迎任何关于为什么会发生这种情况的想法。
最佳答案
这是一个错误,现在应该是 resolved from this commit .
此更改从 v4.0.53 开始可用,现在是 available on MyGet .
关于c# - ServiceStack EnryptedClient 使用 IReturnVoid DTO 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35632952/