title: What could be the reason for this WCF error?
body: <p>My WCF service[using basicHttpBinding] is hosted on IIS 6.Am able to access it using ?wsdl in the service url in  IE browser .</p>
  
  <p>I've a presenation layer in my winforms client and I added the reference of this service using ServiceReferences option in VS.Net which then  generated a proxy.</p>
  
  <p>When I call a method on this service, am getting this exception.What could I be missing here ?Thanks.</p>
  
  <blockquote>
    <p>"Value cannot be null.Parameter name uri."  at
    System.ServiceModel.Description.ClientViaBehavior..ctor(Uri uri)<br>
    at System.ServiceModel.Configuration.ClientViaElement.CreateBehavior()
    at
    System.ServiceModel.Description.ConfigLoader.LoadBehaviors[T](ServiceModelExtensionCollectionElement<code>1
    behaviorElement, KeyedByTypeCollection</code>1 behaviors, Boolean
    commonBehaviors)</p>
    
    <p>at
    System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint
    serviceEndpoint, String configurationName)</p>
    
    <p>at System.ServiceModel.ChannelFactory.ApplyConfiguration(String
    configurationName)     at
    System.ServiceModel.ChannelFactory.InitializeEndpoint(String
    configurationName, EndpointAddress address)     at
    System.ServiceModel.ChannelFactory<code>1..ctor(String
    endpointConfigurationName, EndpointAddress remoteAddress)     at
    System.ServiceModel.EndpointTrait</code>1.CreateSimplexFactory()     at
    System.ServiceModel.EndpointTrait<code>1.CreateChannelFactory()     at
    System.ServiceModel.ClientBase</code>1.CreateChannelFactoryRef(EndpointTrait<code>1
    endpointTrait)     at
    System.ServiceModel.ClientBase</code>1.InitializeChannelFactoryRef()     at
    System.ServiceModel.ClientBase`1..ctor()     at
    TestingClient..ctor() in C:\Presentation\Service
    References\ServiceReference1\Reference.cs:line 268</p>
  </blockquote>
  
  <p>Here is my config xml for server and client:</p>
  
  <p>*Server:</p>
  
  <pre><code>&lt;system.serviceModel&gt; 
      &lt;bindings&gt; 
        &lt;basicHttpBinding&gt; 
          &lt;binding name="ProviderBinding" closeTimeout="00:01:00" openTimeout="00:01:00" 
                 receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" 
                 bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
                 maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
                 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; 
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
                          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; 
            &lt;security mode="Transport"&gt; 
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; 
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; 
            &lt;/security&gt; 
          &lt;/binding&gt; 
        &lt;/basicHttpBinding&gt; 
      &lt;/bindings&gt; 
      &lt;services&gt; 
        &lt;service name="PTSWeb.PriceTestingService" behaviorConfiguration="PTSWeb.Service1Behavior"&gt; 
          &lt;!-- Service Endpoints --&gt; 
          &lt;endpoint address="" binding="basicHttpBinding" contract="PTSWeb.IPriceTesting"&gt; 
            &lt;identity&gt; 
              &lt;dns value="localhost"/&gt; 
            &lt;/identity&gt; 
          &lt;/endpoint&gt; 
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt; 
        &lt;/service&gt; 
      &lt;/services&gt; 
      &lt;behaviors&gt; 
        &lt;serviceBehaviors&gt; 
          &lt;behavior name="PTSWeb.Service1Behavior"&gt; 
                  &lt;serviceMetadata httpGetEnabled="true"/&gt; 
            &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt; 
          &lt;/behavior&gt; 
        &lt;/serviceBehaviors&gt; 
      &lt;/behaviors&gt; 
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>*Client:</p>
  
  <pre><code>&lt;system.serviceModel&gt; 
      &lt;client&gt; 
        &lt;endpoint address="http://localhost/PTSWeb/PTSWebService.svc" 
          behaviorConfiguration="PTSWeb.Service1Behavior" binding="basicHttpBinding" 
          bindingConfiguration="IPriceTestingBinding" contract="IPriceTesting" 
          name="IPriceTestingPort" /&gt; 
        &lt;endpoint address="https://qaserver/webservice" 
                  binding="basicHttpBinding" bindingConfiguration="ProviderBinding" 
                  contract="Provider" name="ProviderPort" /&gt;      
      &lt;/client&gt; 
      &lt;bindings&gt; 
        &lt;basicHttpBinding&gt; 
          &lt;binding name="IPriceTestingBinding" closeTimeout="00:01:00" 
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
            maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
            useDefaultWebProxy="true"&gt; 
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
              maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; 
            &lt;security mode="None" /&gt; 
          &lt;/binding&gt; 
          &lt;binding name="ProviderBinding" closeTimeout="00:01:00" openTimeout="00:01:00" 
                 receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" 
                 bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
                 maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
                 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; 
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
                          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; 
            &lt;security mode="Transport"&gt; 
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; 
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; 
            &lt;/security&gt; 
          &lt;/binding&gt; 
        &lt;/basicHttpBinding&gt; 
      &lt;/bindings&gt; 
  
      &lt;behaviors&gt; 
        &lt;endpointBehaviors&gt;      
          &lt;behavior name="PTSWeb.Service1Behavior"&gt; 
            &lt;clientVia/&gt; 
          &lt;/behavior&gt; 
        &lt;/endpointBehaviors&gt; 
    &lt;/behaviors&gt; 
    &lt;/system.serviceModel&gt;
  </code></pre>