0

I got exception error message as:

Content Type text/xml; charset=utf-8 was not supported by service 
http://localhost:8000/GettingStarted/CalculatorService/.  
The client and service bindings   may be mismatched.

My client application app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ICalculator" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:8000/GettingStarted/CalculatorService/"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICalculator"
            contract="Calculatorservice.ICalculator"  name="BasicHttpBinding_ICalculator" />
    </client>
</system.serviceModel>
</configuration>

My service app.config is

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<appSettings>
 <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
  <service name="GettingStartedLib.CalculatorService">
    <host>
      <baseAddresses>
        <add baseAddress = "http://localhost:8000/GettingStarted/CalculatorService/" />
      </baseAddresses>
    </host>
   <endpoint address="" binding="basicHttpBinding" contract="GettingStartedLib.ICalculator">
     <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
     <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
  </behaviors>
  </system.serviceModel>
  </configuration>

I am new to WCF services. I am totally confused am not able to figure out where I went wrong. I did not hosted the wcf service in my IIS yet.Am able to browse successfully once the wcf host application runs(console application to run service)

  • i think **[this ques](http://stackoverflow.com/questions/5243929/wcf-service-client-the-content-type-text-html-charset-utf-8-of-the-response-me)** can help you. Check **[this ques]http://stackoverflow.com/questions/8250251/wcf-content-type-text-xml-charset-utf-8-was-not-supported-by-service)** also... – Paritosh Jun 06 '13 at 12:47
  • browse the svc file first to check that everyhting is ok. Also, set set to True property includeExceptionDetailInFaults in service config. – Cybermaxs Jun 06 '13 at 12:53
  • I haven't host in IIS.i browse "http://localhost:8000/GettingStarted/CalculatorService/"and getting a debug page. – Arun Chandran Chackachattil Jun 06 '13 at 13:03
  • If you are browsing through a proxy check out the link Parse posted. Are you using a updated service proxy (reference) from the client? How do you create the proxy? – Jocke Jun 07 '13 at 08:10

0 Answers0