views:

39

answers:

3

We suddenly started receiving this error when invoking the helloworld method in our webservice project:

This is the error:


The website cannot display the page HTTP 500 Most likely causes: The website is under maintenance. The website has a programming error. What you can try: Refresh the page.

 Go back to the previous page. 

 More information 

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.


It worked fine yesterday but today we have started receiving this totally baffling us. We have added another Webservice project and it works fine without any issue. Not making sense why it is not working with the existing project. Please let me know if you you have any suggestions. Thanks Navin

A: 

That is just a generic error message that could mean anything. You need to check your error logs to get a more detailed description of the problem.

Chris Diver
A: 

500 Internal Server error is usually send when either the HTTP request or the SOAP payload is malformed. Since you are working in a HelloWorld project, my best guess would be that either the webservice has not been deployed or in the url in client is wrong. Try first web_serviceurl?wsdl to see if the service is deployed. If you see the wsdl in the browser then the service is ok, the problem is in the client. Check if you changed something in the client and now you can not invoke the web service anymore

A: 

You might want to add tracing when developing your webservices, this is a great post on WCF Tracing.

Tracing WCF

Add this to your 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>

Open up the Visual Studio Command Line Console and write: svctraceviewer then open up your tracefile in this viewer, you might need to select "View all files" to find the file you specified for tracing.

Also remember that you cannot open a trace log when the WCF Service is running.

Filip Ekberg