简体   繁体   English

SWAGGER错误。 服务器在处理请求时遇到错误

[英]SWAGGER Error. The server encountered an error processing the request

I'm getting this error in swagger UI. 我在招摇的用户界面中收到此错误。 I'm stock in this error for almost 3 days. 我有将近3天的时间库存此错误。 Please help me what is the problem. 请帮我什么问题。 I'm using this as my references https://github.com/abelsilva/swaggerwcf 我使用它作为我的参考https://github.com/abelsilva/swaggerwcf

Swagger UI错误响应

    [OperationContract]
    [WebInvoke(Method = "PUT",
         UriTemplate = "UpdateJob/{UserName}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json)]
    [SwaggerWcf.Attributes.SwaggerWcfPath("Update Job", "Update a job in Portal")]
    PortalJob UpdateJob(
        [SwaggerWcfParameter(true, "This is the Username assigned to a company to allow service processing")]
        String UserName,
        [SwaggerWcfParameter(true, "This is the populated job object")]
        PortalJob job);

Here's my sample json entry: 这是我的示例json条目:

{
  "UserName": "Manila_user",
  "JobID": 157,
  "Site": "ATL",
  "SiteID": 1,
  "ClientName": "Manila Devs",
  "ClientID": 14,
  "ParentProductName": "Manila Parent Product",
  "ProductID": 1519,
  "JobStatus": "Received",
  "JobStatusID": 1,
  "UniqueID": 0,
  "RecordAddedDate": "2016-12-12",
  "ReceivedDate": "2016-12-12",
  "ReleaseDate": "2016-12-12",
  "RequiredMailDate": "2016-12-12",
  "PrintedDate": "2016-12-12",
  "MailedQuantity": 25,
  "MailedDate": "2016-12-12",
  "BillingQuantity": 0,
  "InvoiceNumber": "11",
  "InvoiceDate": "2016-12-12",
  "RejectedQuantity": 0,
  "RejectedReason": "test",
  "ActiveRecord": 0,
  "RecordLastChangedBy": "WCF",
  "RecordLastChangedDate": "2016-12-12",
  "SequenceNum": 0,
  "StatusEventDate": "2016-12-12",
  "StatusEventChangedBy": "WCF",
  "Notes": "test",
  "OnlineApproval": "2016-12-12",
  "UserApproval": 0,
  "FileID": 170,
  "FileName": "test",
  "ReceivedQuantity": 0,
  "JobNumber": 0,
  "GroupName": "Manila Group",
  "Flex1": "string 1",
  "Flex2": "string 2",
  "Flex3": "string 3",
  "TrackingID": 123,
  "ImpressionCount": 0,
  "GroupID": 5358
}

I received this error with SwaggerWCF as well. 我也收到SwaggerWCF的此错误。 I was able to determine the problem was a dependency on Newtonsoft.Json by enabling tracing on my application. 通过在我的应用程序上启用跟踪 ,我能够确定问题是对Newtonsoft.Json的依赖。 Here was the error I found. 这是我发现的错误。

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. System.IO.FileLoadException:无法加载文件或程序集“ Newtonsoft.Json,版本= 8.0.0.0,文化=中性,PublicKeyToken = 30ad4fe6b2a6aeed”或其依赖项之一。 The located assembly's manifest definition does not match the assembly reference. 找到的程序集的清单定义与程序集引用不匹配。 (Exception from HRESULT: 0x80131040) (来自HRESULT的异常:0x80131040)

I reinstalled Newtonsoft through NuGet and that resolved my problem. 我通过NuGet重新安装了Newtonsoft,这解决了我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IIS 8中的WCF和EntityFramework错误服务器在处理请求时遇到错误 - WCF and EntityFramework error in IIS 8 The server encountered an error processing the request 服务器在处理请求时遇到错误-服务不存在 - The server encountered an error processing the request - the service does not exist 错误。 处理您的请求时发生错误 - Error. An error occurred while processing your request 将json参数传递给WCF函数,并给出错误消息“服务器在处理请求时遇到错误。 请参阅服务器日志以获取更多详细信息” - passing json parameters to WCF function giving error “The server encountered an error processing the request. See server logs for more details” solrnet服务器连接错误。 远程服务器返回错误:(400)错误的请求 - solrnet server connection error. The remote server returned an error: (400) Bad Request C#异步并等待错误。 等待后代码未处理 - c# async and await error. Code not processing after await 远程服务器返回错误:(500)Internal Server Error。 - The remote server returned an error: (500) Internal Server Error. HTTP DELETE请求返回(405)方法不允许错误。 为什么? - HTTP DELETE Request returning a (405) Method Not Allowed Error. Why? Sys.WebForms.PageRequestManagerServerErrorException:在服务器上处理请求时发生未知错误。” - Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server." Android到ASP.NET错误处理请求 - Android to ASP.NET error processing the request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM