Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

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

 
 
Thread Tools Display Modes
Old 03-04-2006   #1 (permalink)
hazz
Guest


 

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()


Old 03-04-2006   #2 (permalink)
hazz
Guest


 

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()
>
>





Old 03-04-2006   #3 (permalink)
hazz
Guest


 

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

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()
>>
>>

>
>
>



Old 03-04-2006   #4 (permalink)
Fabio Cavalcante
Guest


 

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()
>>>
>>>

>>
>>
>>

>
>



 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Output all content of text file in different columns Jason1008 PowerShell 3 06-04-2008 12:16 AM
Using Add-Content to add text to a certain location of a file. greatbarrier86 PowerShell 1 01-31-2008 02:12 AM
Searching for content in text files with powershell snofire PowerShell 5 12-31-2007 08:55 PM
Text content on InkCanvas Raghavendra Avalon 0 01-22-2007 01:33 AM








Vistax64.com 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 2005-2008

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 47 48 49 50