【问题标题】:Http 500 error when invoking a helloworld method in webservice在 web 服务中调用 helloworld 方法时出现 Http 500 错误
【发布时间】:2010-07-12 08:24:57
【问题描述】:

在我们的 web 服务项目中调用 helloworld 方法时,我们突然开始收到此错误:

这是错误:


网站无法显示页面 HTTP 500 最可能的原因: 网站正在维护中。这 网站有编程错误。 你可以尝试什么: 刷新页面。

 Go back to the previous page. 

 More information 

此错误(HTTP 500 内部服务器 错误)表示您所在的网站 访问有一个服务器问题 阻止网页显示。

有关 HTTP 的更多信息 错误,请参阅帮助。


昨天它工作得很好,但今天我们开始收到这让我们完全困惑的消息。 我们添加了另一个 Webservice 项目,它运行良好,没有任何问题。 为什么它不能与现有项目一起使用是没有意义的。 如果您有任何建议,请告诉我。 谢谢 纳文

【问题讨论】:

  • ...哪种ws,哪种平台,哪种语言...

标签: asp.net web-services


【解决方案1】:

这只是一个通用的错误消息,可能意味着任何事情。您需要检查错误日志以获得更详细的问题描述。

【讨论】:

    【解决方案2】:

    当 HTTP 请求或 SOAP 负载格式不正确时,通常会发送 500 内部服务器错误。由于您在 HelloWorld 项目中工作,我最好的猜测是 Web 服务尚未部署或客户端中的 url 错误。 首先尝试 web_serviceurl?wsdl 以查看服务是否已部署。如果您在浏览器中看到 wsdl,则服务正常,问题出在客户端。检查您是否更改了客户端中的某些内容,现在您无法再调用 Web 服务了

    【讨论】:

      【解决方案3】:

      您可能希望在开发 Web 服务时添加跟踪,这是 WCF Tracing 上的一篇很棒的帖子。

      跟踪 WCF

      将此添加到您的 Web.config

      <configuration>
            <system.serviceModel>
                  <diagnostics>
                        <messageLogging logMessagesAtTransportLevel="true"
                                          logMessagesAtServiceLevel="true"
                                          logEntireMessage ="true"
                                          maxMessagesToLog="1000"/>
                  </diagnostics>
            </system.serviceModel>
            <system.diagnostics>
                  <sharedListeners>
                        <add name="textListener"
                                type="System.Diagnostics.XmlWriterTraceListener"
                                 initializeData="c:\temp\logs\msgs.e2e"/>
                  </sharedListeners>
                  <sources>
                        <source name="System.ServiceModel.MessageLogging"
                                    switchValue="All">
                              <listeners>
                                    <add name="textListener"/>
                              </listeners>
                        </source>
                        <source name="System.ServiceModel" switchValue="All">
                              <listeners>
                                    <add name="textListener" />
                              </listeners>
                        </source>
                  </sources>
            </system.diagnostics>
      </configuration>
      

      打开 Visual Studio 命令行控制台并写入:svctraceviewer 然后在此查看器中打开您的跟踪文件,您可能需要选择“查看所有文件”以找到您指定的跟踪文件。

      还请记住,当 WCF 服务运行时,您无法打开跟踪日志。

      【讨论】:

        猜你喜欢
        • 2014-08-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-06
        • 2016-08-03
        • 2020-03-13
        • 1970-01-01
        相关资源
        最近更新 更多