servicestack,Deserialization,servicestack" /> servicestack,Deserialization,servicestack" />

Deserialization 使用IRequiresRequestStream时出现意外序列化异常

Deserialization 使用IRequiresRequestStream时出现意外序列化异常,deserialization,servicestack,Deserialization,servicestack,我们有一个请求Dto,定义如下: public class AddDocumentByUploadBinaryRequest: AddDocumentRequest, IRequiresRequestStream { public string FileName { get; set; } public Stream RequestStream { get; set; } } AddDocumentRequest类定义为: public class AddDocumentRe

我们有一个请求Dto,定义如下:

public class AddDocumentByUploadBinaryRequest: AddDocumentRequest, IRequiresRequestStream
{
    public string FileName { get; set; }

    public Stream RequestStream { get; set; }
}
AddDocumentRequest类定义为:

public class AddDocumentRequest: IReturn<ResponseBase>
{
    public Guid Id { get; set; }

    public string[] Tags { get; set; }

    public Guid? LotId { get; set; }

    public Guid? ContactId { get; set; }

    // never need it to attach document to existing bill
    //public Guid? BillId { get; set; }

    public Guid? FolioId { get; set; }

    public Guid? JobTaskId { get; set; }

    public Guid? TaskId { get; set; }

    public Guid? TenantInvoiceId { get; set; }

    public Guid? InspectionTaskId { get; set; }

    public Guid? InspectionReportAreaId { get; set; }

    public Guid? InMessageId { get; set; }

    public DocumentTypes? DocumentType { get; set; }

    public EventLinkTypes? DocumentArea {   get; set; }

    public Guid? MessageId { get; set; }

    public Guid? LinkId { 
        get {
            switch (DocumentArea) {
                //case EventLinkTypes.Bill:
                //  return BillId;
                case EventLinkTypes.Contact:
                    return ContactId;
                case EventLinkTypes.Inspection:
                    return InspectionTaskId;
                case EventLinkTypes.InspectionReport:
                    return InspectionTaskId;
                case EventLinkTypes.InspectionReportArea:
                    return InspectionReportAreaId;
                case EventLinkTypes.Job:
                    return JobTaskId;
                case EventLinkTypes.Lot:
                    return LotId;
                case EventLinkTypes.Task:
                    return TaskId;
                case EventLinkTypes.Message:
                    return MessageId;
                default:
                    return FolioId;
            }
        }
    }
}
公共类AddDocumentRequest:IReturn
{
公共Guid Id{get;set;}
公共字符串[]标记{get;set;}
公共Guid?LotId{get;set;}
公共Guid?联系人ID{get;set;}
//不需要将文件附加到现有账单上
//公共Guid?BillId{get;set;}
公共Guid?对开本{get;set;}
公共Guid?JobTaskId{get;set;}
公共Guid?任务ID{get;set;}
公共Guid?TenantInvoiceId{get;set;}
公共Guid?InspectionTaskId{get;set;}
公共Guid?InspectionReportAreaId{get;set;}
公共Guid?InMessageId{get;set;}
公共文档类型?文档类型{get;set;}
公共事件链接类型?DocumentArea{get;set;}
公共Guid?消息ID{get;set;}
公共Guid?LinkId{
得到{
开关(文件区){
//案例事件链接类型。账单:
//返回BillId;
案例事件链接类型。联系人:
返回联系人ID;
案例事件链接类型。检查:
返回检查任务ID;
案例EventLinkTypes.InspectionReport:
返回检查任务ID;
案例EventLinkTypes.InspectionReportArea:
退货检验报告区域ID;
案例事件链接类型。作业:
返回作业任务ID;
案例事件链接类型。批次:
返回液;
案例事件链接类型。任务:
返回TaskId;
案例事件链接类型。消息:
返回MessageId;
违约:
返回叶状体;
}
}
}
}
API大部分时间都能正常工作,但偶尔会出现“无法绑定到请求”错误,详细信息如下:

无法绑定到请求“AddDocumentByUploadBinaryRequest”;错误代码:SerializationException;字段名:���身份证件�����; 信息:'�Z~�L�_$�6j�Ǒ�Xƾ��ԯ㵂���;W/�����K� 6.��;ׯG $�O�`�v�J��A.�Z�[S]幉>�>����[安��O
X�n$�请包含失败请求的原始HTTP头。StackTrace也会有帮助。请注意,这可能不是导致此问题的原因,因为ServiceStack仍在尝试使用QueryString来填充请求。请包含失败请求的原始HTTP头。StackTrace也会有帮助。请注意,它可能不是bo这是因为ServiceStack仍然尝试使用QueryString来填充请求。