Click here to Skip to main content
       

ASP.NET

 
AnswerRe: controls in ASP.Net Pinmemberjkirkerx28-Nov-12 12:11 
AnswerRe: controls in ASP.Net Pinmembermark merrens28-Nov-12 12:21 
AnswerRe: controls in ASP.Net [modified] PinmemberCommDev8-Dec-12 22:32 
QuestionMicrosoft Office Excel cannot access the file Pinmemberumamahesh202027-Nov-12 23:52 
QuestionhttpModule Type Language Module will not load in Visual Studio debugger PinmemberRaimundo2a27-Nov-12 22:50 
AnswerRe: httpModule Type Language Module will not load in Visual Studio debugger PinmvpRichard MacCutchan28-Nov-12 0:10 
GeneralRe: httpModule Type Language Module will not load in Visual Studio debugger PinmemberRaimundo2a28-Nov-12 4:16 
QuestionException: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pinmemberindian14327-Nov-12 13:35 
Hi All,
 
I have a WCF Service (Ex name: MyWCFService) which has all the database access and business logic mechanism, which is hosted in IIS using BasicHttpBinding. This WCF service is created by me. One of my collegue also created a WCF service called JasonProxyService which consumes MyWCFService, converts the result into Jason and gives it to UI, UI is using Ajax. The JasonProxyservice doesnt have configuration (like in web config it doesnt have elements , etc, which is unusual for me), and this JasonProxyservice has only two files .svc and svc.vb added to an asp.net application which has the UI also (the asp.net application has all the UI and ajax etc). There is no interface for contract, the ServiceContract attribute is defined right on top of the class and the methods in the class are defined with OperationContract attribute on top of them. When I tried to add interace and define it as service contract and put the WCF service configuration in the webconfig file, simply the Ajax isnt working. Then I left that option.
The reason for keeping JasonProxyService and UI in the same project is to avoid cross domain, becuase Ajax doesnt allow cross domain and our organization also not interested in cross domain because of security. The developer who wrote JasonProxyservice has left the project. Now it has come to my plate. This is what the problem is. I am really struggling with it for a while.
For solution, as first step I wrote logger to understand what is the problem, I am getting the below exception, and I am new to the json world. Please help me. Below is my exception, any help would be really helpfull.
 
System.ServiceModel.ProtocolException: 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
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;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
 '. ---> 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)
   --- End of inner exception stack trace ---
 
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.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
 
Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at WA.LNI.StayAtWork.Public.Web.StayAtWorkServiceReference.IStayAtWorkService.SetContactInfo(UserInfo userInfo)
   at WA.LNI.StayAtWork.Public.Web.StayAtWorkServiceReference.StayAtWorkServiceClient.SetContactInfo(UserInfo userInfo) in D:\source\SourceCode\StayatWork-VS2010\WA.LNI.StayAtWork.Public.Web\WA.LNI.StayAtWork.Public.Web\Service References\StayAtWorkServiceReference\Reference.vb:line 2848
   at WA.LNI.StayAtWork.Public.Web.JSONProxyService.SetContactInfoJSON(UserInfo dto) in D:\source\SourceCode\StayatWork-VS2010\WA.LNI.StayAtWork.Public.Web\WA.LNI.StayAtWork.Public.Web\JSONProxyService.svc.vb:line 359
 
Thanks & Regards,
 
Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pinmemberjkirkerx28-Nov-12 16:55 
GeneralRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pinmemberindian14329-Nov-12 7:46 
GeneralRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pinmemberjkirkerx29-Nov-12 10:02 
Questionduplicate insert for no reason! PinmemberJassim Rahma27-Nov-12 10:29 
QuestionError: Could not load file or assembly 'log4net, Version=1.2.10.0 PinmemberSuper_Developer26-Nov-12 19:41 
QuestionCould not load file or assembly 'log4net, Version=1.2.10.0 PinmemberSuper_Developer26-Nov-12 19:38 
AnswerRe: Could not load file or assembly 'log4net, Version=1.2.10.0 PinmemberAli Al Omairi(Abu AlHassan)26-Nov-12 20:58 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 PinmemberSuper_Developer26-Nov-12 23:38 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 PinmemberAli Al Omairi(Abu AlHassan)26-Nov-12 23:54 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 PinmemberSuper_Developer27-Nov-12 0:31 
QuestionASP.NET usefull controls PinmemberYoyosch26-Nov-12 19:10 
AnswerRe: ASP.NET usefull controls Pinmemberbatterybuying27-Nov-12 2:38 
GeneralRe: ASP.NET usefull controls Pinmembergilvani29-Nov-12 4:37 
AnswerRe: ASP.NET usefull controls PinmemberD Waller8-Dec-12 1:43 
QuestionASP MVC update panel PinmemberYoyosch26-Nov-12 19:04 
AnswerRe: ASP MVC update panel Pinmembergilvani28-Nov-12 2:48 
AnswerRe: ASP MVC update panel Pinmembermayankgupta68828-Nov-12 15:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 20 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid