我一直在关注微软关于调用他们新的 Web API 的文档,但是我在传递正确的参数时遇到了问题。
我认为问题出在Source
应该是 a 的参数上EntityType
,但是我找不到任何有关如何通过GET
未绑定函数上的 a 传递它的文档。
谁能指出我正确的方向?
附言。参数ViewDate
必须单独传入
我正在拨打的电话:
http://hostname:5555/WPK/api/data/v8.0/IncrementKnowledgeArticleViewCount(Source= '67322227-C8F7-E511-810C-005056B608D3',ViewDate=@p1,Location=1,Count=1)?@p1 ='2016-04-04T17:00:00Z'
返回错误信息:
{“消息”:“无法将“EdmValidCoreModelPrimitiveType”类型的对象转换为“Microsoft.OData.Edm.IEdmStructuredType”类型。”、“ExceptionMessage”:“无法将“EdmValidCoreModelPrimitiveType”类型的对象转换为“Microsoft.OData”类型。 Edm.IEdmStructuredType'.", "ExceptionType": "System.InvalidCastException", "StackTrace": " 在 Microsoft.Crm.Extensibility.OData.CrmODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)\r\n at System .Web.OData.Routing.ODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection)\r\n 在 System.Web.Http.Routing.HttpRoute。ProcessConstraint(HttpRequestMessage 请求,对象约束,字符串参数名称,HttpRouteValueDictionary 值,HttpRouteDirection routeDirection)\r\n 在 System.Web.Http.Routing.HttpRoute.ProcessConstraints(HttpRequestMessage 请求,HttpRouteValueDictionary 值,HttpRouteDirection routeDirection)\r\n 在系统。 Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n at System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)", "ErrorCode": 500 }HttpRouteDirection routeDirection)\r\n 在 System.Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage 请求)\r\n 在 System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)", “错误代码”:500 }HttpRouteDirection routeDirection)\r\n 在 System.Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage 请求)\r\n 在 System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)", “错误代码”:500 }