Please do not delete this as a duplicate
I have a windows service that I am passing an array of objects to. When the array contains less than 150 objects it works successfully. When I pass more than 150 objects I get the (413) Request Entity Too Large Error.
I have tried the feedback from other articles regarding readerQuotas node values and maxReceivedMessageSize, but I am still receiving the error and I am stuck as to what I am still doing wrong.
Here is the app.config of the windows service:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBindingNoSecurity" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport clientCredentialType="None"/>
<message establishSecurityContext="false" negotiateServiceCredential="false"/>
</security>
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</wsHttpBinding>
<mexHttpBinding>
<binding name="mexHttpBinding"/>
</mexHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="SE.Responder.Integration.AmiOutboundService.AmiObService" behaviorConfiguration="Service1Behavior">
<endpoint address="wsHttp" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingNoSecurity" contract="SE.Responder.Integration.AmiOutboundService.IAmiObService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="basicHttp" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" name="basicHttp" contract="SE.Responder.Integration.AmiOutboundService.IAmiObService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/SE.Responder.Integration.AmiOutboundService/AmiObService/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
And here is the app.config of the executable that passes the data to the windows service:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IAmiObService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" >
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8732/SE.Responder.Integration.AmiOutboundService/AmiObService/AmiOBService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAmiObService" contract="AmiObService.IAmiObService" name="WSHttpBinding_IAmiObService" />
</client>
After reviewing the source code for the application that was having this issue, I found that the wcf service was being hosted in the C# code. I then applied the fix in code as described in the following stack overflow issue,
MaxReceivedMessageSize in WCF Hosted Service in console application,
specifically the following lines,
var wsHttpBinding = new WSHttpBinding();
wsHttpBinding.MaxReceivedMessageSize = int.MaxValue;
Service.AddServiceEndpoint(typeof(TInterfaceContract), wsHttpBinding, EndpointAddress);
which corrected the issue.
Related
I have facing above error after adding the maxItemsInObjectGraph="2147483647" parameter both server and client.
However in my project large number of data can transferred using "datatable" objects without any issue.
This error occurred large number of data transferred with using "List<>" objects.
My dotnetframework is 4.0, but I found this error NOT found in dotnetframework 4.5 and large number of data can transferring using "List<>" object without error. Also this is Windows base project.
Please anyone can solved this problem. Here are the my server and client app.cofig configurations.
Thanks!!!
My Service;
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling
maxConcurrentSessions="1200"
maxConcurrentCalls="192"
maxConcurrentInstances="1392"
/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding maxReceivedMessageSize="2147483647" name="netTcpBinding" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="CommonBehavior" name="MyBLL">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBinding" name="MyEndPoint" contract="IMy">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/MySVC"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
My Client;
<system.serviceModel>
<client>
<endpoint name="MyEndPoint" address="net.tcp://localhost:8000/MySVC" binding="netTcpBinding" bindingConfiguration="netTcpBinding" contract="IMy" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding" maxReceivedMessageSize="2147483647" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="CommonBehavior" name="MyEndPoint">
<endpoint address="" behaviorConfiguration="CommonBehavior" binding="netTcpBinding" bindingConfiguration="netTcpBinding" name="MyEndPoint" contract="Imy">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/MySVC" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
Finally I found my mistake in client config and I was solved my problem.
My mistake was behaviorConfiguration="CommonBehavior" tag not in the client, endpoint section. After added this part the problem was successfully solved and large number of records exist generic list I can transferred from server to client.
This is my corrected client config -
<system.serviceModel>
<client>
<endpoint name="MyEndPoint" behaviorConfiguration="CommonBehavior" address="net.tcp://localhost:8000/MySVC" binding="netTcpBinding" bindingConfiguration="netTcpBinding" contract="IMy" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding" maxReceivedMessageSize="2147483647" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
I am new to StackOverflow so forgive me if I get this wrong. I am getting a bad request error when calling a wcf service. The method takes a Byte array as a parameter. It works on small files but not on files that are 80000 bytes in length. I have posted the web config files below.
This is in my web config file
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileService" 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:4199/FileService.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IFileService" contract="ConStringServices.IFileService"
name="BasicHttpBinding_IFileService" />
</client>
This is in my service web config file
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicBinding" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyService">
<endpoint bindingConfiguration="basicBinding" address="" binding="basicHttpBinding" contract="ConStringTest.Services.IFileService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<!-- 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"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Update: This is the method that is called within the service. Like I said, it works with small files.
public Boolean UploadFile(Byte[] file, string filename)
{
FileStream stream = new FileStream("C:\\Temp\\" + filename, FileMode.Create, FileAccess.ReadWrite);
stream.Write(file, 0, file.Length);
stream.Close();
Console.WriteLine(file.Length);
return true;
}
What am I doing wrong? Any help would be greatly appreciated.
Update: I have amended the service config file as above but still no joy.
Update: It is fixed. I just had to make the service name the Fully Qualified Name with namespace. ie. ConStringTest.Services.FileService
The problem is with the config where you are putting the name. This is not an arbritary name but rather the name of the service class file. If its wrong the config will not be applied and will use the default config. Change MyService to be the fully qualified name of the service class..
<service behaviorConfiguration="MyServiceBehavior" name="ConStringTest.Services.FileService">
<endpoint bindingConfiguration="basicBinding" address="" binding="basicHttpBinding" contract="ConStringTest.Services.IFileService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
I have some legacy code here, which has a WCF Service.
The service is called by a client through a generatedProxy.cs
I thought it should be simple and wanted to generate my own
proxy by using svcutil.exe, but I get lots of different errors,
depending on what I try (using running exe for download, using
assembly, using webconfig). For example the svcutil tells me
that the service may not publish metadata (seems to me that
this is not true).
the webconfig has:
<serviceMetadata httpGetEnabled="true"/>
And it has a multisite binding
How can I generate such a proxy? Want to change some things in the contracts
and then have a current version of the proxy generated.
At the moment I have no service reference, as it has the some errors
when adding one as the svcutil does.
Any ideas?
-edit-
The services are published through a selfhosted service, quite similar to
the one in the WCF examples in the msdn. There are the endpoints for
multiple services, which are implemented in dlls.
-edit 2-
Here is the app.config of the self hosting service
I have replaced some names, just to make it less special.
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="PersonDataModelContainer" connectionString="metadata=res://*/PersonDataModel.csdl|res://*/PersonDataModel.ssdl|res://*/PersonDataModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|DataDirectory|\PersonDatabase.sdf"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<system.serviceModel>
<bindings>
<netMsmqBinding>
<binding name="TransactionalNoSecurity" durable="true" exactlyOnce="true" maxReceivedMessageSize="2147483647" maxRetryCycles="1" receiveRetryCount="20" retryCycleDelay="00:05:00">
<security mode="None"></security>
</binding>
</netMsmqBinding>
<basicHttpBinding>
<binding name="TransportSecurity" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</basicHttpBinding>
<ws2007HttpBinding>
<binding name="NoSecurity" transactionFlow="true" maxReceivedMessageSize="200000" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="None"></security>
</binding>
<binding name="UNMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="UserName" establishSecurityContext="true"/>
</security>
</binding>
<binding name="CertMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Certificate" establishSecurityContext="true"/>
</security>
</binding>
<binding name="DomainMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Windows" establishSecurityContext="true"/>
</security>
</binding>
<binding name="RM_NoSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<reliableSession enabled="true" ordered="false"/>
<security mode="None"></security>
</binding>
</ws2007HttpBinding>
<netTcpBinding>
<binding name="NoSecurity" transactionFlow="true">
<security mode="None"></security>
</binding>
<binding name="DomainMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
<binding name="CertMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="True" policyVersion="Policy15"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MessagePlatform.LoggingService.GeneralLoggingService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/"/>
</baseAddresses>
</host>
<endpoint address="Logging" binding="basicHttpBinding" name="LoggingService" contract="MessagePlatform.LoggingService.Contracts.ILoggingService"/>
</service>
<service name="MessagePlatform.GatewayService.GeneralGatewayService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/"/>
</baseAddresses>
</host>
<endpoint address="gateway" binding="basicHttpBinding" name="GatewayService" contract="MessagePlatform.GatewayService.Contracts.IGatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db2GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb2GatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db1GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb1GatewayService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<client>
<endpoint name="LoggingServiceEP" address="http://localhost/Logging" binding="basicHttpBinding" contract="MessagePlatform.LoggingService.ILoggingService">
</endpoint>
<endpoint name="GatewayServiceEP" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IGatewayService">
</endpoint>
<endpoint name="GatewayServiceDb2" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IDb2GatewayService">
</endpoint>
<endpoint name="GatewayServiceDb1" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IDb1GatewayService">
</endpoint>
</client>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>
</configuration>
You also need to enable the Metadata Exchange Endpoint so you can create a new proxy:
<service name="MessagePlatform.GatewayService.GeneralGatewayService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/"/>
</baseAddresses>
</host>
<endpoint address="gateway" binding="basicHttpBinding" name="GatewayService" contract="MessagePlatform.GatewayService.Contracts.IGatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db2GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb2GatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db1GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb1GatewayService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
and run
svcutil http://localhost:8000/mex
I am using WCF and found this error:
" The caller was not authenticated by the service."
I have used this code in client.config file:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None">
<message clientCredentialType="Windows" negotiateServiceCredential="false" />
</security>
</binding>
<binding name="WSHttpBinding_IEMRProWCFService" />
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://pionbuggs-pc:4567/EMRProWCFService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEMRProWCFService"
contract="EMRProWCFService.IEMRProWCFService" name="WSHttpBinding_IEMRProWCFService">
<identity>
<dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" />
</identity>
</endpoint>
</client>
</system.serviceModel>
And below is the code in the service.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation />
<httpRuntime maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<services>
<service name="WCFService.EMRProWCFService">
<endpoint address="" binding="wsHttpBinding" contract="WCFService.IEMRProWCFService">
<identity>
<dns value="http://pionbuggs-pc:4567/EMRProWCFService.svc" />
</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" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="WebConfiguration" maxBufferSize="65536" maxReceivedMessageSize="2147483647" transferMode="Streamed">
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
Instead of using binding="wsHttpBinding", try using just a basic, changing you client endopint to:
<endpoint address="http://pionbuggs-pc:4567/EMRProWCFService.svc"
binding="basicHttpBinding" bindingConfiguration="WSHttpBinding_IEMRProWCFService"
contract="EMRProWCFService.IEMRProWCFService" name="WSHttpBinding_IEMRProWCFService">
and on your service to:
<endpoint address="" binding="basicHttpBinding" contract="WCFService.IEMRProWCFService">
The error is that you use advanced security that requires you to use authentication, unless there are security constrains that require it.
Here's some info about it:
BasicHttpBinding vs WsHttpBinding vs WebHttpBinding
I am using VSTS 2008 + C# + .Net 3.0. I am using self-hosted WCF. When executing the following statement, there is the following binding not found error. I have posted my whole app.config file, any ideas what is wrong?
ServiceHost host = new ServiceHost(typeof(MyWCFService));
Error message,
Configuration binding extension 'system.serviceModel/bindings/MyBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.
Full app.config,
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="MyBinding"
closeTimeout="00:00:10"
openTimeout="00:00:20"
receiveTimeout="00:00:30"
sendTimeout="00:00:40"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="WeakWildcard"
maxReceivedMessageSize="100000000"
messageEncoding="Mtom"
proxyAddress="http://foo/bar"
textEncoding="utf-16"
useDefaultWebProxy="false">
<reliableSession ordered="false"
inactivityTimeout="00:02:00"
enabled="true" />
<security mode="Transport">
<transport clientCredentialType="Digest"
proxyCredentialType="None"
realm="someRealm" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="MyWCFService"
behaviorConfiguration="mexServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9090/MyService"/>
</baseAddresses>
</host>
<endpoint address="" binding="MyBinding" contract="IMyService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mexServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
thanks in advance,
George
You've misunderstood how to configure bindings - your binding in the endpoint needs to be a known protocol;
<endpoint address="" binding="wsHttpBinding" contract="IMyService"/>
Once you have that you can then specify the binding configuration you have defined within the settings for that protocol using the bindingConfiguration element thus
<endpoint address="" binding="wsHttpBinding"
bindingConfiguration="MyBinding" contract="IMyService"/>