My ServicesReferences.ClientConfig has information of my internal WCF service
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISynchronization"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:9867/Services/Synchronization.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ISynchronization"
contract="SyncServiceReference.ISynchronization"
name="BasicHttpBinding_ISynchronization" />
</client>
</system.serviceModel>
</configuration>
but when I add EntityService information
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISynchronization"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="EntityService"
address="http://localhost:8000/EntityService.svc"
binding="customBinding"
contract="IdeaBlade.EntityModel.IEntityServiceContract"/>
<endpoint name="EntityServer"
address="http://localhost:8000/EntityServer.svc"
binding="customBinding"
contract="IdeaBlade.EntityModel.IEntityServerContract"/>
<endpoint address="http://localhost:9867/Services/Synchronization.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ISynchronization"
contract="SyncServiceReference.ISynchronization"
name="BasicHttpBinding_ISynchronization" />
</client>
</system.serviceModel>
</configuration>
along with following custom code
public class ProxyEvents : IdeaBlade.EntityModel.ServiceProxyEvents
{
public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint)
{
base.OnEndpointCreated(endpoint);
// Sample adding Gzip compression programmatically.
// Use when using a ServiceReferences.ClientConfig where a gzip binding cannot be added declaratively (this is a
// Silverlight limitation since it does not support extensions via config).
if (endpoint.Binding is CustomBinding)
{
var binding = endpoint.Binding as CustomBinding;
var elements = binding.CreateBindingElements();
// Swap out binary/text message encoding for gzip/binary
var encoding = elements.Find<MessageEncodingBindingElement>();
if (encoding != null)
{
elements.Remove(encoding);
}
encoding = new GZipMessageEncodingBindingElement();
elements.Insert(0, encoding);
elements.Add(new HttpTransportBindingElement { MaxReceivedMessageSize = 2147483647, MaxBufferSize = 2147483647 });
endpoint.Binding = new CustomBinding(elements);
}
else if (endpoint.Binding == null)
{
var customBinding = new CustomBinding();
var elements = customBinding.CreateBindingElements();
var encoding = new GZipMessageEncodingBindingElement();
elements.Insert(0, encoding);
elements.Add(new HttpTransportBindingElement { MaxReceivedMessageSize = 2147483647, MaxBufferSize = 2147483647 });
endpoint.Binding = new CustomBinding(elements);
}
}
}
things are starting to work as expected. But when I remove client information from ClientConfig, I get the said exception.
Any idea what is possibly happening