title: Two endpoint (soap ,json) and one service method
body: <p>I have that service</p>
  
  <pre><code>        [OperationContract]
      [WebGet(UriTemplate = "/GetData")]
      List&lt;FieldInfo&gt; GetSerializedData();
  </code></pre>
  
  <p>and web.config</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;webServices&gt;
        &lt;protocols&gt;
          &lt;add name="HttpGet" /&gt;
          &lt;add name="HttpPost" /&gt;
        &lt;/protocols&gt;
      &lt;/webServices&gt;
      &lt;httpRuntime  executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/&gt;
      &lt;compilation debug="true" targetFramework="4.0"/&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;webHttpBinding&gt;
          &lt;binding name="webHttpBindingSettings" maxBufferPoolSize="524288" maxReceivedMessageSize="654321" sendTimeout="00:10:00" closeTimeout="00:01:00" openTimeout="00:10:00" receiveTimeout="00:10:00"&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" /&gt;
            &lt;/security&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
          &lt;/binding&gt;
        &lt;/webHttpBinding&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="wsHttpBindingSettings" maxBufferPoolSize="524288" maxReceivedMessageSize="654321" sendTimeout="00:10:00" closeTimeout="00:01:00" openTimeout="00:10:00" receiveTimeout="00:10:00"&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" /&gt;
            &lt;/security&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="MetadataBehavior" name="ServiceModel.Service"&gt;
          &lt;endpoint name="soap" address="soap" behaviorConfiguration="Default" binding="wsHttpBinding"
            bindingConfiguration="wsHttpBindingSettings" contract="ServiceModel.IService" /&gt;
          &lt;endpoint name="Json" address="json" behaviorConfiguration="JSON" binding="webHttpBinding"
          bindingConfiguration="webHttpBindingSettings" contract="ServiceModel.IService" /&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://service.com/Service.svc/" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="MetadataBehavior"&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="JSON"&gt;
            &lt;webHttp automaticFormatSelectionEnabled="true"/&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="10000000"/&gt;
          &lt;/behavior&gt;
          &lt;behavior name="Default"&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="10000000"/&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
  </code></pre>
  
  <p>Why on the client side only one endpoint is generated ? </p>
  
  <pre><code>    &lt;client&gt;
    &lt;endpoint address="http://service.renault.com/Service.svc/soap"
      binding="wsHttpBinding" bindingConfiguration="soap" contract="ServiceReference1.IService"
      name="soap" /&gt;
  &lt;/client&gt;
  </code></pre>
  
  <p>My point is to execute service method from asp.net page codebehind and wcf return data in soap or json depends on ContentType. But how to set in asp.net page content type to application/json when it have text/html content. I have problem with understand it.</p>