错误WCF:Base-64 char数组或字符串的长度无效

时间:2016-12-16 03:07:14

标签: c# asp.net wcf ado.net wcf-rest

创建WCF Rest Post时出现错误Invalid length for a Base-64 char array or string

IServiceRequest.cs

    [OperationContract]
    [WebInvoke(Method = "POST",
          RequestFormat = WebMessageFormat.Json,
          ResponseFormat = WebMessageFormat.Json,
          UriTemplate = "/InsertData?ticket={ticket}&request={request}&category={category}&subCategory={subCategory}&subject={subject}&body={body}&assignto={assignto}&status={status}&fileName={fileName}&fileContent={fileContent}&fileBinary={fileBinary}&IsActive={IsActive}&createdBy={createdBy}&ACNo={ACNo}")]
    IEnumerable<USP_INSERT_DATA_Result> InsertData(string ticket, string request, string category, string subCategory, string subject, string body, string assignto, int status, string fileName, string fileContent, byte[] fileBinary, bool IsActive, string createdBy, int ACNo);

ServiceRequest.svc.cs

public IEnumerable<USP_INSERT_DATA_Result> InsertData(string ticket, string request, string category, string subCategory, string subject, string body, string assignto, int status, string fileName, string fileContent, byte[] fileBinary, bool IsActive, string createdBy, int ACNo)
    {
        return objapi.USP_INSERT_DATA(ticket, request, category, subCategory, subject, body, assignto, status, fileName, fileContent, fileBinary, IsActive, createdBy, ACNo).AsEnumerable();
    }

USP_INSERT_DATA_Result.cs

public partial class USP_INSERT_DATA_Result
{
    public string TICKET_NUMBER { get; set; }
    public string REQUESTER_ACCOUNT { get; set; }
    public string CATEGORY { get; set; }
    public string SUBCATEGORY { get; set; }
    public string SUBJECT { get; set; }
    public string BODY { get; set; }
    public string ASSIGNED_TO { get; set; }
    public bool IS_ACTIVE { get; set; }
    public string CREATED_DATE { get; set; }
    public string CREATED_BY { get; set; }
    public int AC_NO { get; set; }
    public int STATUS { get; set; }
    public string FILE_NAME { get; set; }
    public string FILE_CONTENT { get; set; }
    public byte FILE_BINARY { get; set; }
}

我想错过哪些代码来发布这样的休息服务?

错误日志:

at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) at System.Convert.FromBase64String(String s) at System.ServiceModel.Dispatcher.QueryStringConverter.ConvertStringToValue(String parameter, Type parameterType) at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

0 个答案:

没有答案