简体   繁体   English

由于内部错误,服务器无法处理请求

[英]The server was unable to process the request due to an internal error

When i try to load method from webservice, i get an error: 当我尝试从webservice加载方法时,我收到一个错误:

"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs" “由于内部错误,服务器无法处理请求。有关错误的更多信息,请在服务器上启用IncludeExceptionDetailInFaults(来自ServiceBehaviorAttribute或配置行为),以便将异常信息发送回客户端,或根据Microsoft .NET Framework SDK文档打开跟踪并检查服务器跟踪日志“

This is my app.config endpoint def: 这是我的app.config端点def:

<services>
  <service name="Service" behaviorConfiguration="debug">
</services>

<client>
  <endpoint name="Service" address="net.tcp://localhost:12708/" binding="netTcpBinding" bindingConfiguration="netTcp" contract="path.IService" >
    <identity>
      <servicePrincipalName />
    </identity>
  </endpoint>
</client>

<serviceBehaviors>
    <behavior name="debug">
      <serviceDebug includeExceptionDetailInFaults="True" />
    </behavior>
  </serviceBehaviors>

I cannot see more information event if i have declared serviceBehaviors. 如果我声明了serviceBehaviors,我看不到更多信息事件。 Could somebody tell me how can i see more details about this error? 有人可以告诉我如何才能看到有关此错误的更多详细信息?

The message of the error is quite clear. 错误的信息非常清楚。 The server is configured to hide internal errors for security reasons.This is the default behaviour according to the fault handling in WCF MSDN post . 服务器配置为出于安全原因隐藏内部错误。这是根据WCF MSDN帖子中故障处理的默认行为。

I see two options, both suppose that you have access to the server: 我看到两个选项,都假设您有权访问服务器:

  • Enable showing the error details See the fault handling in WCF MSDN post . 启用显示错误详细信息请参阅WCF MSDN帖子中故障处理 It provides details on how to setup your configuration, in the "Provide Additional Information When an Exception Occurs" section. 它提供了有关如何设置配置的详细信息,请参阅“在发生异常时提供其他信息”部分。

  • Debug using actual breakpoints This would be better. 使用实际断点进行调试这会更好。 In my opinion, no error message could actually give you the insights a debugging session does. 在我看来,没有任何错误消息实际上可以为您提供调试会话的见解。

Hope I helped! 希望我帮忙!

When running this locally, you can debug the service by attaching to it using Tools -> Attach to Process . 在本地运行时,您可以使用Tools - > Attach to Process服务来调试服务。

In the list of available processes, look for the process W3wp.exe , with Type Managed (...) x64 or Managed (...) x86 , depending what you've configured your service to run as. 在可用进程列表中,查找进程W3wp.exe ,类型为Managed (...) x64Managed (...) x86 ,具体取决于您将服务配置为运行方式。

Click Attatch , set a couple of breakpoints in your service, and try to access it again in your web-browser, and they should be hit. 单击Attatch ,在您的服务中设置几个断点,然后尝试在Web浏览器中再次访问它,它们应该被点击。

Note that you'll need to publish your WS in Debug mode for this to work. 请注意,您需要在调试模式下发布WS才能使其正常工作。

Solution: My service wasn't started. 解决方案:我的服务未启动。 Because we run services locally, I needed to open the required solution and run the service locally via RG -> Create new instance. 因为我们在本地运行服务,所以我需要打开所需的解决方案并通过RG本地运行服务 - >创建新实例。

How I do I know about this? 我怎么知道这件事? My log files are stored in c:/temp. 我的日志文件存储在c:/ temp中。 In this location, appeared a new log file and there I found more info about my error. 在这个位置,出现了一个新的日志文件,在那里我发现了有关我的错误的更多信息。 (All the time I was thinking that the details about my error message will enter into my basic log file, but I didn't expect another log file. (我一直以为我的错误消息的详细信息将进入我的基本日志文件,但我没想到会有另一个日志文件。

So, Reason : web service didn't work. 所以, 原因 :网络服务不起作用。
Solution : Start service localy: Rb -> create new service. 解决方案 :启动服务localy:Rb - >创建新服务。

you should add diagnostics your config file: 你应该添加诊断你的配置文件:

 <system.diagnostics> 
      <sources> 
        <source name="System.ServiceModel" 
                switchValue="All" 
                propagateActivity="true"> 
          <listeners> 
            <add name="traceListener" 
                type="System.Diagnostics.XmlWriterTraceListener" 
                initializeData= "D:\AppLogs\Traces.svclog" /> 
          </listeners> 
        </source> 
      </sources> 
    </system.diagnostics>

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

相关问题 wcf 由于内部错误,服务器无法处理请求 - Wcf The server was unable to process the request due to an internal error “由于内部错误,服务器无法处理请求”。 WCF 服务,在 IIS 上部署时 - 'The server was unable to process the request due to an internal error'. WCF Service, when deployed on IIS 服务器无法处理请求 - Server was unable to process request 通过IIS发布网站后,由于内部服务器错误,回调请求失败 - Callback request failed due to an internal server error after publishing a website Through IIS 加载XML文件时服务器无法处理请求错误 - Server unable to process request error when loading XML file 肥皂异常错误..服务器无法处理请求 - Soap Exception error..Server was unable to process the request 服务器无法处理请求SalesForce出站消息 - Server was unable to process request SalesForce Outbound Message 500内部服务器错误与Ajax请求 - 500 Internal Server Error With Ajax Request Ajax发布请求中的内部服务器错误 - Internal server error in ajax post request 远程调试msvsmon.exe VS2015或无法附加到进程时表达式计算器中的内部错误。 rpc服务器不可用 - Internal error in the expression evaluator when remote debugging msvsmon.exe VS2015 or unable to attach to the process. the rpc server is unavailable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM