title: A missing or empty content type header was found when trying to read a message. The content type header is required
body: <p>I am using a SAP odata service and I added it as a web reference in visual studio 2012. </p>
  
  <pre><code> Uri serviceUri = new Uri("http://zbc.net:4521/sap/opu/odata/sap/Emp/", UriKind.Absolute);
              Emp context = new Emp(serviceUri);
  
              context.Credentials = new System.Net.NetworkCredential("loginanme", "pass");
  
              var query = from b in context.Employees
                          where b.Role == "Admin"
                          select b;
  
              foreach (var myObject in query)
              {
                  Console.WriteLine("\n name: {0} | role: {1}", myObject.name, myObject.Role);
  
              }
  </code></pre>
  
  <p>When I execute the code above, I get the following error:</p>
  
  <pre><code>"An error occurred while processing this request."
  
  InnerException: "A missing or empty content type header was found when trying to read a message. The content type header is required."
  
  this is the query that VS2012 produces:
  
  Query: {http://zbc.net:4521/sap/opu/odata/sap/Emp/Employees()?$filter=Role eq 'Admin'}
  
  StackTrace:
  
     at Microsoft.Data.OData.ODataMessageReader.GetContentTypeHeader()
     at Microsoft.Data.OData.ODataMessageReader.TryGetSinglePayloadKindResultFromContentType(IEnumerable`1&amp; payloadKindResults, MediaType&amp; contentType, Encoding&amp; contentEncoding)
     at Microsoft.Data.OData.ODataMessageReader.DetectPayloadKind()
     at System.Data.Services.Client.Materialization.ODataMaterializer.CreateODataMessageReader(IODataResponseMessage responseMessage, ResponseInfo responseInfo, Boolean projectionQuery, ODataPayloadKind&amp; payloadKind)
     at System.Data.Services.Client.Materialization.ODataMaterializer.CreateMaterializerForMessage(IODataResponseMessage responseMessage, ResponseInfo responseInfo, Type materializerType, QueryComponents queryComponents, ProjectionPlan plan, ODataPayloadKind payloadKind)
     at System.Data.Services.Client.MaterializeAtom..ctor(ResponseInfo responseInfo, QueryComponents queryComponents, ProjectionPlan plan, IODataResponseMessage responseMessage, ODataPayloadKind payloadKind)
     at System.Data.Services.Client.QueryResult.CreateMaterializer(ProjectionPlan plan, ODataPayloadKind payloadKind)
     at System.Data.Services.Client.QueryResult.ProcessResult[TElement](ProjectionPlan plan)
     at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
  </code></pre>
  
  <p><strong>Response from RESTClient (firefox add-on)</strong></p>
  
  <pre><code>Status Code: 200 OK
  Content-Encoding: gzip
  Content-Length: 566
  Content-Type: application/xml
  Last-Modified: Tue, 09 Jul 2013 13:03:22 GMT
  Server: SAP NetWeaver Application Server / ABAP 731
  dataserviceversion: 2.0
  </code></pre>
  
  <p><strong>Response body</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" 
      xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" 
      xmlns:sap="http://www.sap.com/Protocols/SAPData"&gt;
      &lt;edmx:DataServices m:DataServiceVersion="2.0"&gt;
      &lt;Schema Namespace="Emp" xml:lang="en" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"&gt;
      &lt;EntityType Name="Bank" sap:content-version="1"&gt;
      &lt;Key&gt;
          &lt;PropertyRef Name="Admin"/&gt;
      &lt;/Key&gt;
       &lt;Property Name="Name" Type="Edm.String" MaxLength="35" sap:label="Name"/&gt;
      &lt;Property Name="street" Type="Edm.String" MaxLength="35" sap:label="Street"/&gt;
      &lt;Property Name="Role" Type="Edm.String" MaxLength="35" sap:label="Role"/&gt;
      &lt;Property Name="Region" Type="Edm.String" MaxLength="3" sap:label="Region"/&gt;
      &lt;/EntityType&gt;
      &lt;EntityContainer Name="Emp" m:IsDefaultEntityContainer="true"&gt;
      &lt;EntitySet Name="Employees" EntityType="Emp.Employee" sap:deletable="false" sap:content-version="1"/&gt;
      &lt;/EntityContainer&gt;
      &lt;atom:link rel="self" href="http://zbc.net:4521/sap/opu/odata/sap/Emp/$metadata" xmlns:atom="http://www.w3.org/2005/Atom"/&gt;
      &lt;atom:link rel="latest-version" href="http://zbc.net:4521/sap/opu/odata/sap/Emp/$metadata" 
      xmlns:atom="http://www.w3.org/2005/Atom"/&gt;
      &lt;/Schema&gt;
      &lt;/edmx:DataServices&gt;
      &lt;/edmx:Edmx&gt;
  </code></pre>
  
  <p><strong>From Fiddler I get the following response:</strong></p>
  
  <pre><code>HTTP/1.1 401 Unauthorized
  www-authenticate: Basic realm="SAP NetWeaver Application Server [SVD/800]"
  content-length: 2180
  content-type: text/html; charset=utf-8
  server: SAP NetWeaver Application Server / ABAP 731
  </code></pre>
  
  <p>How come in fiddler I get a 401? How can I provide a login and pass in Fiddler so that I don't get a 401?</p>