Click here to Skip to main content
15,887,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
My server Config

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="PosConnectionString" connectionString="Data Source=.;Initial catalog=Master;Uid=sa;Pwd=123"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxRequestLength="2147483647" />

  </system.web>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\logs\Traces.svclog"/>
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
  <system.serviceModel>
    <services>
      <service name="PosServiceRef.PosService1">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:1267/PosService1.svc" />
          </baseAddresses>
        </host>
        <endpoint address="" binding="basicHttpBinding"
                bindingConfiguration="basicHttpBinding_IPosService1" contract="PosServiceRef.IPosService1"
                name="BasicHttpBinding_IPosService1" >
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding_IPosService1"  closeTimeout="00:20:00"
          openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>

          <security mode="None"/>
        </binding>
        <!--<binding>
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        </binding>-->
      </basicHttpBinding>
    </bindings>
  
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>




My Client Config
XML
<system.serviceModel>
    <services>


    </services>
    <bindings>
      <basicHttpBinding>
      <binding name="BasicHttpBinding_IPosService11" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        <security mode="None">
          <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
          <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>
      </binding>
    </basicHttpBinding>
    
    </bindings>
    <client>
      <endpoint address="http://localhost:1267/PosService1.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPosService11"
        contract="PosServiceRef.IPosService1" name="BasicHttpBinding_IPosService1" />
    </client>
  </system.serviceModel>
Posted
Updated 24-Nov-14 22:03pm
v4

1 solution

I ran into this problem recently and tried many variations of config settings to get it to work. I came across a solution buried in the depths of some MSDN article after much searchng that suggested removing the binding name which worked.

XML
<binding name="basicHttpBinding_IPosService1"></binding>


In the snippet above remove the binding name.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900