Calling asmx web service from asp.net web app. gives 500 Internal Error RRS feed

  • Question

  • User-610391303 posted

    I am getting following error when we call asmx web service  from asp.net web application. Application and web service are in 3.5 framework and on the same server. It uses certificate for the communication. This error occurs randomly (some time works and some time gives this error). Its on windows server 2008 R2 and IIS7. Anykind of help is highly appreciated. Thanks in advance.

    Error Message: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> (http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd%27%3E)
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <title>500 - Internal server error.</title>
    <style type="text/css">
    body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
    fieldset{padding:0 15px 10px 15px;}
    h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
    #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
    #content{margin:0 0 0 2%;;}
    <div id="header"><h1>Server Error</h1></div>
    <div id="content">
     <div class="content-container"><fieldset>
    Inner Exception: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    Error Source: mscorlib
    Error Details:
    Server stack trace:
       at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)


    After some changes I am getting 500.19 Internal Server Error. Can someone please help me in this issue?


    I found very useful link: http://support.microsoft.com/kb/943891

    This might be very useful to all who are facing such issues. I just removed error page 500.htm from IIS and its settings so that I can get detailed error message.

    Friday, November 2, 2012 9:13 AM

All replies

  • User768703680 posted


    Please follow the following steps.

    Go to Control Panel --> Turn Windows Features On or Off --> Internet Information Services --> World Wide Web Services --> Application Development Features --> All the check boxes are checked.


    Thursday, July 17, 2014 3:09 AM