multiple net.tcp calls to a WCF service - c#

I a have a problem, my client calls a Wcf Service via Net.Tcp.
In a Cycle after almost 200 calls, the service remains locked for approximately 10 minutes, and blocks any other client working with net.tcp protocol.
I Have other clients who call the wcf service via Https, these ones continue to work without problems.
What kind of misconfiguration can be?
Thanks!
here is my web.config
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="AttoCreditoConnection" connectionString="MyConnectionstring" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5.2"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="LargeList" name="AttoCredito.AttoCreditoBiz.AttoCreditoWcf">
<endpoint address="tcp" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
name="AttoCreditoNetTcp" contract="AttoCredito.AttoCreditoBiz.IAttoCreditoWcf" />
<endpoint binding="wsHttpBinding" bindingConfiguration="TransportSecurityBinding"
name="AttoCreditoWcfHttp" contract="AttoCredito.AttoCreditoBiz.IAttoCreditoWcf" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:808" />
<add baseAddress="https://localhost:443" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAttoLegacyWcf" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxBufferSize="10000000" maxReceivedMessageSize="10000000"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="TransportNetTcpBinding" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="50" maxBufferPoolSize="524288"
maxBufferSize="10000000" maxConnections="50" maxReceivedMessageSize="10000000">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:30:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="DocumentaleNetTcp">
<security mode="None" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="TransportSecurityBinding" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="10000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:30:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="false"
establishSecurityContext="false" />
</security>
</binding>
<binding name="DocumentaleHttp">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/AttoLegacy/AttoLegacyWcf.svc"
behaviorConfiguration="LargeList" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IAttoLegacyWcf" contract="AttoLegacyHost.IAttoLegacyWcf"
name="BasicHttpBinding_IAttoLegacyWcf" />
<endpoint address="net.tcp://localhost/AnagraficaBiz/AnagraficaSrv.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AnagraficaHost.IAnagraficaSrv" name="AnagraficaNetTcp" />
<endpoint address="net.tcp://localhost/AttoBiz/AttoExtraction.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AttoHost.IAttoExtraction" name="AttoNetTcp" />
<endpoint address="net.tcp://localhost/ContoCorrenteBiz/ContoCorrenteSrv.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="CcHost.IContoCorrenteSrv" name="ContoCorrenteNetTcp" />
<endpoint address="net.tcp://localhost/ContrattoBiz/ContrattoWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="ContrattoHost.IContrattoWcf" name="ContrattoNetTcp" />
<endpoint address="net.tcp://localhost/MembershipBiz/Membership.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="MembershipHost.IMembership" name="MembershipNetTcp" />
<endpoint address="net.tcp://localhost/ToponomasticaBiz/Toponomastica.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="TopoHost.IToponomastica" name="ToponomasticaNetTcp" />
<endpoint address="net.tcp://localhost/CreditoBiz/CreditoWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="CreditoHost.ICreditoWcf" name="CreditoNetTcp" />
<endpoint address="net.tcp://localhost/EnteDebitoreBiz/EnteDebitoreWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="EnteDebitoreHost.IEnteDebitoreWcf" name="EnteDebitoreNetTcp" />
<endpoint address="net.tcp://localhost/AciBiz/AciBiz.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AciHost.IAciBiz" name="AciBizNetTcp" />
<endpoint address="net.tcp://localhost/DocumentaleBiz/DocumentaleWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="DocumentaleHost.IDocumentaleWcf" name="DocumentaleNetTcp" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="LargeList">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="LargeList">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
<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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

Related

Https and Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding

I have a WCF Service hosting in web site IIS, in Windows Server 2012.
Site Bindings has only
https myhostname.labsoa 443
I call URL in IExplorer https://myhostname.labsoa/RoutingService.svc
I want ONLY call to Wcf Service using https
Note: replace real value by myhostname.labsoa
I get the message error:
Could not find a base address that matches scheme http for the
endpoint with binding WSHttpBinding. Registered base address schemes
are [https]
In my WCF Service host, I have this configuration files:
web.config
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<bindings configSource="Config\system.serviceModel.bindings.config"/>
<services configSource="Config\system.serviceModel.services.config"/>
<behaviors configSource="Config\system.serviceModel.behaviors.config"/>
<client configSource="Config\system.serviceModel.client.config"/>
<routing configSource="Config\system.serviceModel.routing.config"/>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="false"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Config\system.serviceModel.behaviors.config
<behaviors>
<serviceBehaviors>
<behavior name="routingData">
<serviceMetadata httpGetEnabled="True"
httpsGetEnabled="true" />
<routing filterTableName="routingTable1" routeOnHeadersOnly="false" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
Config\system.serviceModel.bindings.config
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Default" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding_Default" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Config\system.serviceModel.services.config
<services>
<service behaviorConfiguration="routingData"
name="System.ServiceModel.Routing.RoutingService">
<host>
<baseAddresses>
<add baseAddress="https://myhostname.labsoa/RoutingService.svc"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<endpoint
address="/Contacto"
binding="wsHttpBinding"
contract="System.ServiceModel.Routing.IRequestReplyRouter"
name="ContactoRouting"
bindingConfiguration="wsHttpBinding_Default"
/>
Any suggestions about it?
Your endpoing configuration doesnt have bindinginConfiguration.
Following configuration
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
should be
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
bindingConfiguration="wsHttpBinding_Default"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />

WCF Client Security defaulting to Windows

I am trying to setup a simple WCF web service with wsHTTPBinding and using a custom Username.
I have the service on a remote server setup with a self signed cert on a different port.
eg: https://service.myserice.com:442/service1.svc
For some reason the client seems to default to windows security even though I hjave set it up as UserName Security.
Here is my web Service config file:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<services>
<service name="AutoSenderWCF.Service1" behaviorConfiguration="Behavior1">
<host>
<baseAddresses>
<add baseAddress="https://service.autosender.com.au:442/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" bindingName="TransportBinding" contract="AutoSenderWCF.IService1"></endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="TransportBinding">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Behavior1">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="AutoSenderWCF.CustomValidator, AutoSenderWCF"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
and my client code (notic ethe security=windows)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="TransportBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://service.autosender.com.au/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="TransportBinding_IService1"
contract="ServiceReference1.IService1" name="TransportBinding_IService1">
<identity>
<servicePrincipalName value="host/wserver" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
It is clearly specified to use Windows in your Client config:
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
Copy that section from Server config.
I beleive i have solved it:
this line.
<endpoint address="" binding="wsHttpBinding" bindingName="TransportBinding" contract="AutoSenderWCF.IService1"></endpoint>
it should not be bindingName it should be bindingConfiguration

SSL endpoint on a WCF service with only XML configuration file

I have a WCF Service with only the xml configuration file and the .exe (so not the complete solution). Can i make existing endpoints secure with https?
If so, how can i do this and how can i connect to it with my client which will be on another pc in the network?
this will be my service xml config:
my binding:
<wsHttpBinding>
<binding
name="HighQuotaWSHttpBinding"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
bypassProxyOnLocal="true"
maxBufferPoolSize="2147483647"
useDefaultWebProxy="false"
maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
my endpoint:
<service
behaviorConfiguration="WebDataServiceBehaviour"
name="Humiq.Integral.WebDataService.Impl.ServiceLayer.WcfLibrary.WebDataService">
<endpoint
address="WebDataService"
binding="wsHttpBinding" bindingConfiguration="HighQuotaWSHttpBinding"
contract="Humiq.Integral.WebDataService.Intf.ServiceLayer.IWebDataService"
name="WebDataServiceHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange"
name="mexManagement" />
<host>
<baseAddresses>
<add baseAddress="http://mylocalip:9650/" />
<add baseAddress="https://mylocalip:9651/" />
</baseAddresses>
</host>
</service>
behaviour:
<behaviors>
<serviceBehaviors>
<!-- Behavior for WebserviceData interface -->
<behavior name="WebDataServiceBehaviour">
<!-- Set throttling of (concurrent) cals -->
<serviceThrottling
maxConcurrentCalls="100"
maxConcurrentSessions="100"
maxConcurrentInstances="100"/>
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="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="2147483646"/>
</behavior>
</serviceBehaviors>
</behaviors>
And this is my client:
<bindings>
<wsHttpBinding>
<binding name="WebDataServiceHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Basic" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://mylocalip:9651/WebDataService" binding="wsHttpBinding"
bindingConfiguration="WebDataServiceHttpBinding" contract="wcf1.IWebDataService"
name="WebDataServiceHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
you need to define the port to use ssl on windows.
it is done with the netsh command, you can read its help:
netsh http add sslcert ipport=0.0.0.0:8732 certhash=4745537760840034c3dea27f940a269b7d470114 appid={00112233-4455-6677-8899-AABBCCDDEEFF}

WCF maxReceivedMessageSize not working

I have a WCF Service that has these configuration settings. When I call it from a client application I still hit the dreaded, "Maximum number of items that can be serialized or deserialized in an object graph is '65536'" What's wrong with my configuration below?
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="LargeBuffer" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="TestWcfService.Service1">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="LargeBuffer" name="ServiceEndPoint"
contract="TestWcfService.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Yes I increased it on the client side to match. And it still hits that limit. My concern is that when it pulls the service reference back, it still sees 65536 as the default size so it never recognizes the larger amount. Any thoughts?
Here's my client side code:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="ServiceEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:61423/Service1.svc" binding="wsHttpBinding"
bindingConfiguration="ServiceEndPoint" contract="LucasImport.IService1"
name="ServiceEndPoint">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>

WCF Error: the client and service bindings may be mismatched?

let see server config and client config. Then help me find difference between these configs!!
Client config
<system.serviceModel>
<client>
<endpoint address="http://localhost/admin2/AdminCentralService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Config"
contract="TIR.ThreeTier.ICommandInvoker"
name="AdminCentralServiceConfig" />
<endpoint binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Config"
contract="TIR.ThreeTier.ICommandInvoker"
name="CommandInvokerConfig" />
</client>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Config"
closeTimeout="00:10:00"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Mtom"
textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Server Config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="AdminCentral.Business.Web.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Config"
closeTimeout="00:10:00"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Mtom"
textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="AdminCentral.Business.Web.Service1Behavior"
name="AdminCentral.Business.Web.AdminCentralService">
<endpoint address=""
binding="wsHttpBinding"
contract="AdminCentral.Business.Web.ICommandInvoker">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
In order to use the customized binding you need to specify bindingConfiguration attribute on the client and server side. Like this:
Server side:
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Config"
contract="AdminCentral.Business.Web.ICommandInvoker">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
Client side:
<endpoint address="!!__!_server_address_!__!!"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Config"
contract="AdminCentral.Business.Web.ICommandInvoker">
</endpoint>

Categories