0

字符串 URL="https://sampleservicebus.servicebus.windows.net/WinPhoneService/"

RestClient client = new RestClient(URL);
     RestRequest request = new RestRequest("getkpimeasuredata", Method.POST);
               KpiDomainData kpidata = new KpiDomainData();
               kpidata.KPIId = 1006;
               kpidata.ScorecardId = 3;
               kpidata.EngineeringOrgId = 11;
               kpidata.DataValuetypeId = 1;
               kpidata.CumulativeMonth = 463;
               kpidata.BusinessOrgId = 1;

               string json = Newtonsoft.Json.JsonConvert.SerializeObject(kpidata);


               json = "{\"kpidata\" : " + json + "}";

               request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
               request.RequestFormat = DataFormat.Json;

               ObservableCollection<KpiMeasureData> kpiDetailsList = await client.ExecuteTaskAsync<ObservableCollection<KpiMeasureData>>(request);


               client.ExecuteAsync(request, response =>
               {
                   if (response.StatusCode == HttpStatusCode.OK)
                   {



                   }

               });

在上述响应中的调用中,我得到 response.statuscode 作为 ExpectationFailed 和 response.Content 如下

实际上,我的 wcf 服务使用 EF,它将实际调用具有 dynamicsql 的 SP 来返回结果集。这是 SP 中动态 sql 的 bcos。我创建了 functionImports 和 Complextype。当我使用 Webclient 而不是 Restclient 时, Restcall 有效。但我只需要使用 Restclient ...请帮助...

   {"ErrorCode":"1001","ErrorMessage":"System.Data.EntityCommandExecutionException: The data reader is incompatible with the specified 'ScaasModel.GetKPIMeasureData_Result'. A member of the type, 'ParamName', does not have a corresponding column in the data reader with the same name.\u000d\u000a   at System.Data.Query.InternalTrees.ColumnMapFactory.GetColumnMapsForType(DbDataReader storeDataReader, EdmType edmType, Dictionary`2 renameList)\u000d\u000a   at System.Data.Query.InternalTrees.ColumnMapFactory.CreateColumnMapFromReaderAndType(DbDataReader storeDataReader, EdmType edmType, EntitySet entitySet, Dictionary`2 renameList)\u000d\u000a   at 
4

0 回答 0