AZGroups.com

Bringing together Arizona Technology Users And Enhancing the Careers of Developers
Welcome to AZGroups.com Sign in | Join | Help
in Search

Calling a web service from ASP.NET 2.0

Last post 06-06-2006, 2:52 PM by jakeb16. 1 replies.
Sort Posts: Previous Next
  •  06-06-2006, 7:34 AM 428

    Calling a web service from ASP.NET 2.0

    I have a ASP.NET 2.0 web service being called from and ASP.NET web site and I get the following error:

    System.InvalidOperationException was unhandled by user code
      Message="Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.\r\nThe request failed with the error message:\r\n--\r\n<html>\r\n    <head>\r\n        <title>Runtime Error</title>\r\n        <style>\r\n         body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} \r\n         p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px}\r\n         b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px}\r\n         H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red }\r\n         H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon }\r\n         pre {font-family:\"Lucida Console\";font-size: .9em}\r\n         .marker {font-weight: bold; color: black;text-decoration: none;}\r\n         .version {color: gray;}\r\n         .error {margin-bottom: 10px;}\r\n         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }\r\n        </style>\r\n    </head>\r\n\r\n    \r\n\r\n           " <h2> <i>Runtime Error< i> h2>< span>\r\n\r\n            <font face='\"Arial,' Helvetica, Geneva, SunSans-Regular, sans-serif \?>\r\n\r\n            <b> Description: b>An occurred server. settings for prevent application from being remotely (for security reasons). It could, however, viewed browsers running local server machine.\r\n            <br><br>\r\n\r\n            <b>Details:< To enable details this specific viewable on remote machines, please create within \?web.config\? file located in root directory web application. This should then have its \?mode\? set \?Off\?.<br><br>\r\n\r\n            <br>\r\n\r\n            <b>Notes:< b> The current you are seeing can be replaced by modifying \?defaultRedirect\? attribute of the application?s <customErrors> configuration tag point to a custom error page URL.<br><br>\r\n\r\n            <table bgcolor='\"white\">\r\n\r\n           ' <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n<!-- Web.Config Configuration File -->\r\n\r\n<configuration>\r\n    <system.web>\r\n        <customErrors mode='\"Off\"/>\r\n   ' defaultRedirect='\"mycustompage.htm\"/>\r\n   ' system.web>\r\n< configuration>< pre>< code>\r\n\r\n                  td>\r\n               tr>\r\n            < table>\r\n\r\n            <br>\r\n\r\n      Source="System.Web.Services"
      StackTrace:
           at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
           at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
           at com.christopherbrandy.www.ZipLookup.GetStatesInfo() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\basicpersonal\8a10bae2\75286aa5\App_WebReferences.roa2ulpx.0.cs:line 143
           at Comments.Page_Load(Object sender, EventArgs e) in d:\BasicPersonal\Comments.aspx.cs:line 23
           at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
           at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
           at System.Web.UI.Control.OnLoad(EventArgs e)
           at System.Web.UI.Control.LoadRecursive()
           at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Any one know why I would get this error?

  •  06-06-2006, 2:52 PM 429 in reply to 428

    Re: Calling a web service from ASP.NET 2.0

    Looking quickly at it,

       it looks like you need to modify you web.config file on your server. Something to do with security settings.

  • View as RSS news feed in XML
    Powered by Community Server, by Telligent Systems