Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)."

 
 
Old 03-04-2006   #1 (permalink)
hazz


 
 

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)."

System.ServiceModel.ProtocolException was unhandled

Is this apparent what this error message would be caused by? This is from
the getting started sample wcf in the winfx sdk.
I see the web.config below is xml/utf-8 where is the text/html response
being generated?
The error occurs in the return base.InnerProxy.Add function in the generated
proxy (TChannel return type)
Where is this content type explicitly set (or is there a default type of
text/html? ) thx. -g


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service
type="Microsoft.ServiceModel.Samples.CalculatorService"
behaviorConfiguration="CalculatorServiceBehavior">
<!-- use base address provided by host -->
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="Binding1"
contract="Microsoft.ServiceModel.Samples.ICalculator"
/>
</service>
</services>

<bindings>
<wsHttpBinding>
<binding name="Binding1" />
</wsHttpBinding>
</bindings>

<behaviors>
<behavior
name="CalculatorServiceBehavior"
returnUnknownExceptionsAsFaults="True" >
</behavior>
</behaviors>

</system.serviceModel>

<system.web>
<compilation debug="true" />
</system.web>

</configuration>






Source="mscorlib"
StackTrace:
Server stack trace:
at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest
request, HttpWebResponse response, HttpChannelFactory factory, WebException
responseException)
at
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message
message, TimeSpan timeout)
at System.ServiceModel.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 ICalculator.Add(Double n1, Double n2)
at CalculatorProxy.Add(Double n1, Double n2) in C:\Program
Files\Microsoft
SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\generatedProxy.cs:line
63
at Microsoft.ServiceModel.Samples.Client.Main() in C:\Program
Files\Microsoft
SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\client.cs:line
22
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()



My System SpecsSystem Spec
Old 03-04-2006   #2 (permalink)
hazz


 
 

Re: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)."

the attached .jpg shows my vs2005 debug session using the WCF 'getting
started sample' -hazz

"hazz" <hazz@sonic.net> wrote in message
news:e$srN3$EGHA.916@TK2MSFTNGP10.phx.gbl...
> System.ServiceModel.ProtocolException was unhandled
>
> Is this apparent what this error message would be caused by? This is from
> the getting started sample wcf in the winfx sdk.
> I see the web.config below is xml/utf-8 where is the text/html response
> being generated?
> The error occurs in the return base.InnerProxy.Add function in the
> generated
> proxy (TChannel return type)
> Where is this content type explicitly set (or is there a default type of
> text/html? ) thx. -g
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.serviceModel>
> <services>
> <service
> type="Microsoft.ServiceModel.Samples.CalculatorService"
> behaviorConfiguration="CalculatorServiceBehavior">
> <!-- use base address provided by host -->
> <endpoint address=""
> binding="wsHttpBinding"
> bindingConfiguration="Binding1"
> contract="Microsoft.ServiceModel.Samples.ICalculator"
> />
> </service>
> </services>
>
> <bindings>
> <wsHttpBinding>
> <binding name="Binding1" />
> </wsHttpBinding>
> </bindings>
>
> <behaviors>
> <behavior
> name="CalculatorServiceBehavior"
> returnUnknownExceptionsAsFaults="True" >
> </behavior>
> </behaviors>
>
> </system.serviceModel>
>
> <system.web>
> <compilation debug="true" />
> </system.web>
>
> </configuration>
>
>
>
>
>
>
> Source="mscorlib"
> StackTrace:
> Server stack trace:
> at
> System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest
> request, HttpWebResponse response, HttpChannelFactory factory,
> WebException
> responseException)
> at
> System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
> timeout)
> at System.ServiceModel.Channels.RequestChannel.Request(Message
> message, TimeSpan timeout)
> at System.ServiceModel.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 ICalculator.Add(Double n1, Double n2)
> at CalculatorProxy.Add(Double n1, Double n2) in C:\Program
> Files\Microsoft
> SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\generatedProxy.cs:line
> 63
> at Microsoft.ServiceModel.Samples.Client.Main() in C:\Program
> Files\Microsoft
> SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\client.cs:line
> 22
> at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
> args)
> at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
> assemblySecurity, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
> at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
>
>





My System SpecsSystem Spec
Old 03-04-2006   #3 (permalink)
Fabio Cavalcante


 
 

Re: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)."

hazz,

Just some more basic information about the problem you were having:
Since your service wasn't working properly, an error page (web page that is)
was being generated and returned, that explains the exception you were
getting (since your client was just getting an error page back, which
content type is text/html, instead of the expected text/xml) , this is a
common eception when IIS/mappings are not properly configured, and hide the
actual error message, which you would have been able to see if you had used
a browser to issue the request.

I'm glad your problem is resolved, but I hope that gives you some more
information about the problem you were facing,

- Fabio Cavalcante
http://www.codesapien.com

"hazz" <hazz@sonic.net> wrote in message
news:ucdA1kaFGHA.3532@TK2MSFTNGP14.phx.gbl...
> Got it to work. It's all in the web.config, app.config and ALSO
> ASPNET_REGIIS.EXE as per the following.
>
> Run "aspnet_regiis.exe -i" from the directory
> "%windir%\microsoft.net\framework\v2.0.50215."
>
> http://66.102.7.104/search?q=cache:C..._reg.exe&hl=en
>
> which pointed to;
>
> http://msdn.microsoft.com/library/de...igobeta1rc.asp
>
>
>
> "hazz" <hazz@sonic.net> wrote in message
> news:O90KNsVFGHA.216@TK2MSFTNGP15.phx.gbl...
>> the attached .jpg shows my vs2005 debug session using the WCF 'getting
>> started sample' -hazz
>>
>> "hazz" <hazz@sonic.net> wrote in message
>> news:e$srN3$EGHA.916@TK2MSFTNGP10.phx.gbl...
>>> System.ServiceModel.ProtocolException was unhandled
>>>
>>> Is this apparent what this error message would be caused by? This is
>>> from
>>> the getting started sample wcf in the winfx sdk.
>>> I see the web.config below is xml/utf-8 where is the text/html response
>>> being generated?
>>> The error occurs in the return base.InnerProxy.Add function in the
>>> generated
>>> proxy (TChannel return type)
>>> Where is this content type explicitly set (or is there a default type of
>>> text/html? ) thx. -g
>>>
>>>
>>> <?xml version="1.0" encoding="utf-8" ?>
>>> <configuration>
>>> <system.serviceModel>
>>> <services>
>>> <service
>>> type="Microsoft.ServiceModel.Samples.CalculatorService"
>>> behaviorConfiguration="CalculatorServiceBehavior">
>>> <!-- use base address provided by host -->
>>> <endpoint address=""
>>> binding="wsHttpBinding"
>>> bindingConfiguration="Binding1"
>>>
>>> contract="Microsoft.ServiceModel.Samples.ICalculator"
>>> />
>>> </service>
>>> </services>
>>>
>>> <bindings>
>>> <wsHttpBinding>
>>> <binding name="Binding1" />
>>> </wsHttpBinding>
>>> </bindings>
>>>
>>> <behaviors>
>>> <behavior
>>> name="CalculatorServiceBehavior"
>>> returnUnknownExceptionsAsFaults="True" >
>>> </behavior>
>>> </behaviors>
>>>
>>> </system.serviceModel>
>>>
>>> <system.web>
>>> <compilation debug="true" />
>>> </system.web>
>>>
>>> </configuration>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Source="mscorlib"
>>> StackTrace:
>>> Server stack trace:
>>> at
>>> System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest
>>> request, HttpWebResponse response, HttpChannelFactory factory,
>>> WebException
>>> responseException)
>>> at
>>> System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
>>> timeout)
>>> at System.ServiceModel.Channels.RequestChannel.Request(Message
>>> message, TimeSpan timeout)
>>> at System.ServiceModel.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 ICalculator.Add(Double n1, Double n2)
>>> at CalculatorProxy.Add(Double n1, Double n2) in C:\Program
>>> Files\Microsoft
>>> SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\generatedProxy.cs:line
>>> 63
>>> at Microsoft.ServiceModel.Samples.Client.Main() in C:\Program
>>> Files\Microsoft
>>> SDKs\Windows\v1.0\samples\Allsamples\WindowsCommunicationFoundation\TechnologySamples\Basic\GettingStarted\CS\client\client.cs:line
>>> 22
>>> at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
>>> args)
>>> at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
>>> assemblySecurity, String[] args)
>>> at
>>> Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
>>> at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>>> at System.Threading.ExecutionContext.Run(ExecutionContext
>>> executionContext, ContextCallback callback, Object state)
>>> at System.Threading.ThreadHelper.ThreadStart()
>>>
>>>

>>
>>
>>

>
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Issues with EML file with content-type tnef. How to resolve? Vista mail
how to make the email content text indexed by "Windows Desktop Search 4.0" ? Live Mail
Using Add-Content to add text to a certain location of a file. PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46