title: The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8)
body: <p>I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references. </p>
  
  <p>This is the error I am getting</p>
  
  <pre><code>The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).
  </code></pre>
  
  <p>How do I change this to use the correct content type?</p>
  
  <p>Here is my config file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  &lt;startup&gt; 
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /&gt;
  &lt;/startup&gt;
  &lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="G2WebServiceSoap11Binding" /&gt;
          &lt;/basicHttpBinding&gt;
          &lt;customBinding&gt;
              &lt;binding name="G2WebServiceSoap12Binding"&gt;
                  &lt;textMessageEncoding messageVersion="Soap12" /&gt;
                  &lt;httpTransport /&gt;
              &lt;/binding&gt;
          &lt;/customBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://XXX.XX.XX.XX:XX/janus/services/G2WebService.G2WebServiceHttpSoap11Endpoint/"
              binding="basicHttpBinding" bindingConfiguration="G2WebServiceSoap11Binding"
              contract="G2ServiceReference.G2WebServicePortType"
              name="G2WebServiceHttpSoap11Endpoint" /&gt;
          &lt;endpoint address="http://XXX.XX.XX.XX:XX/janus/services/G2WebService.G2WebServiceHttpSoap12Endpoint/"
              binding="customBinding" bindingConfiguration="G2WebServiceSoap12Binding"
              contract="G2ServiceReference.G2WebServicePortType"
              name="G2WebServiceHttpSoap12Endpoint" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p></p>
  
  <p>here is the stack</p>
  
  <pre><code>{System.ServiceModel.ProtocolException: The content type application/xml;charset=utf-8 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: '&lt;Exception&gt;org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /janus/services/G2WebService and the WSA Action = null&amp;#xd;
      at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:89)&amp;#xd;
      at org.apache.axis2.engine.Phase.invoke(Phase.java:333)&amp;#xd;
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)&amp;#xd;
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)&amp;#xd;
      at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:136)&amp;#xd;
      at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)&amp;#xd;
      at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:829)&amp;#xd;
      at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:255)&amp;#xd;
      at com.rm.janus.webservice.GroupCallServlet.doGet(GroupCallServlet.java:33)&amp;#xd;
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)&amp;#xd;
      at javax.servlet.http.HttpSer'. ---&gt; System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
     at System.Net.HttpWebRequest.GetResponse()
     at System.ServiceModel.Channels.HttpChannelFactory`1.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`1 factory, WebException responseException, ChannelBinding channelBinding)
     at System.ServiceModel.Channels.HttpChannelFactory`1.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.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&amp; msgData, Int32 type)
     at InetgrisG2TestApp.G2ServiceReference.G2WebServicePortType.getStudentData(getStudentDataRequest request)
     at InetgrisG2TestApp.G2ServiceReference.G2WebServicePortTypeClient.G2TestApp.G2ServiceReference.G2WebServicePortType.getStudentData(getStudentDataRequest request) in c:\Users\s\Documents\Visual Studio 2012\Projects\G2TestApp\InetgrisG2TestApp\Service References\G2ServiceReference\Reference.cs:line 2981
     at InetgrisG2TestApp.G2ServiceReference.G2WebServicePortTypeClient.getStudentData(ServiceRequest serviceReq) in c:\Users\s\Documents\Visual Studio 2012\Projects\G2TestApp\G2TestApp\Service References\G2ServiceReference\Reference.cs:line 2987
     at InetgrisG2TestApp.Program.Main(String[] args) in c:\Users\s\Documents\Visual Studio 2012\Projects\G2TestApp\G2TestApp\Program.cs:line 57}
  </code></pre>