WCF WPF Silverlight wsDualHttpBinding pollingDuplexHttpBinding - wcf

I'm fighting hours on hours to get this Silverlight duplex to work but fail after fail ,
I have A)WCF Service Appllication B) WPF Client C) Silverlight Client ( Do I need +host ?! )
I connect successfully A<=>B - working good , my problem is A<=>C (Silverlight Duplex Client)
Can I have 2 endpoints somehow ? wsDualHttpBinding & pollingDuplexHttpBinding ? Tried and fail
An endpoint configuration section for contract 'Service2.IService1' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.
Can pollingDuplexHttpBinding works on WPF ?
Help ! Thanks !
Web.Config
<!-- Register the binding extension from the SDK. -->
<extensions>
<bindingExtensions>
<add name="pollingDuplexHttpBinding"
type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,
System.ServiceModel.PollingDuplex,
Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
<client>
<endpoint address="http://localhost:8732/Service1/" binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBinding" contract="TheWCFService.IService1" name="WSDualHttpBinding_Service1" />
</client>
<bindings>
<wsDualHttpBinding>
<binding name="wsDualHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483646" maxArrayLength="2147483646" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</wsDualHttpBinding>
<pollingDuplexHttpBinding>
<binding name="multipleMessagesPerPollPollingDuplexHttpBinding"
duplexMode="MultipleMessagesPerPoll"
maxOutputDelay="00:00:07"/>
</pollingDuplexHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="" name="TheWCFService.Service1">
<endpoint address=""
binding="wsDualHttpBinding"
bindingConfiguration="wsDualHttpBinding"
contract="TheWCFService.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
bindingConfiguration=""
contract="IMetadataExchange" />
<!--<endpoint
address="/2"
binding="pollingDuplexHttpBinding"
bindingConfiguration="multipleMessagesPerPollPollingDuplexHttpBinding"
contract="TheWCFService.IService1">
</endpoint>-->
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<!-- 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" />
<serviceThrottling maxConcurrentSessions="500" maxConcurrentCalls="500" maxConcurrentInstances="500" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

So yes It's possible more than 2 endpoints :
Step I :
<endpoint address="wsDualHttpBinding"
binding="wsDualHttpBinding"
bindingConfiguration="wsDualHttpBinding"
contract="TheWCFService.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
bindingConfiguration=""
contract="IMetadataExchange" />
<endpoint
address="pollingDuplexHttpBinding"
binding="pollingDuplexHttpBinding"
bindingConfiguration="multipleMessagesPerPollPollingDuplexHttpBinding"
contract="TheWCFService.IService1">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Service1/" />
</baseAddresses>
</host>
Step II :Very Important : WCF Cross Domain SecurityException
http://www.itscodingtime.com/post/Silverlight-to-WCF-Cross-Domain-SecurityException.aspx
Step III :
Silverlight Client :
var x = new WCFService.Service1Client(
new PollingDuplexHttpBinding { DuplexMode = PollingDuplexMode.MultipleMessagesPerPoll, },
new EndpointAddress(#"http://localhost:59732/Service1.svc/pollingDuplexHttpBinding")
);
WPF Client :
> _objProxy = new Service1Client(new InstanceContext(this),
> "WSDualHttpBinding_IService1");

Related

http wcf error "Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding..."

am getting this error when i try to call my custom svc file from sharpoint. i have posted my web.config file here, could you guys tell wats wrong with this.
am trying to have my custom webservice in the sharepoint, so i created a project but due to this error i could not browse my web methods.
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="AlertWcfService.CustomServiceBehaviour"
name="AlertWcfService.AlertService">
<endpoint address="http://localhost:2000/" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration"
contract="AlertWcfService.IAlertService" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:2000/"></add>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Certificate" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="AlertWcfService.CustomServiceBehaviour">
<!--<serviceMetadata httpsGetEnabled="false"/>-->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
The error is that you're not using HTTPS, but you're using an MEX binding for HTTPS rather than HTTP. TO fix this, change this line:
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
To
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
In your interface declaration IAlertService, add the name attribute beside the namespace if you do not have it yet...
[ServiceContract(Name = "NameNeeded", Namespace = "http://blahbalh")]
public interface IAlertService
{
.....
}

Can we have one service implementing multiple serviceContract. Each servicecontract is exposed as seperate endpoint with same address

I am facing an issue where same configuration works on my development machine but not working on some other machine.
i have four servicecontract interface. These interface are implemented by single service.For each service contract i have seperate endpoint but these endpoint have same address. This setting works on my machine but fails on testing machine.
Please clarify.
Here is the configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="ABC.Toolkit.PluginHost.AdapterService">
<endpoint address="AdapterService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.ILocalSystemStore">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="AdapterService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.IRemoteDeviceStore">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="AdapterService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.IPrinterStore">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="AdapterService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.ITemplateStore">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/Services/" />
<add baseAddress="net.pipe://localhost/Services" />
</baseAddresses>
</host>
</service>
<service name="ABC.RemoteDeviceTestService">
<endpoint address="net.pipe://localhost/Services/RemoteDeviceTestService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.IRemoteDeviceTest">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/Services/" />
<add baseAddress="net.pipe://localhost/Services" />
</baseAddresses>
</host>
</service>
<service name="ABC.PrinterTestService">
<endpoint address="net.pipe://localhost/Services/PrinterTestService" bindingConfiguration="DicomConfigNamedPipeBinding"
binding="netNamedPipeBinding" contract="ABC.IPrinterTest">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/Services/" />
<add baseAddress="net.pipe://localhost/Services" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="NetTcp_Reliable" sendTimeout="00:00:10"
receiveTimeout="24.20:31:23.6470000">
<reliableSession ordered="true" inactivityTimeout="24.20:31:23.6470000"
enabled="true" />
</binding>
</netTcpBinding>
<netNamedPipeBinding>
<binding name="DicomConfigNamedPipeBinding" closeTimeout="23:59:59" openTimeout="23:59:59" receiveTimeout="23:59:59"
sendTimeout="23:59:59" transactionFlow="false" transferMode="Buffered" maxBufferPoolSize="2147483646" maxBufferSize="2147483646"
maxConnections="10" maxReceivedMessageSize="2147483646">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
</netNamedPipeBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehave">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false"/>
<!-- 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>
</system.serviceModel>
</configuration>
The error message i am getting is contract filter mismatch at Endpoint dispatcher

WCF Routing service error - ContractFilter mismatch at the EndpointDispatcher

The situation is as follows: I have an internal server running some WCF services, and I want them to be accessible from the internet at large. To this end, I have written a routing service that is running on our public facing web-server.
This routing service appears to work, however when I attempt to invoke a method, I always get the following error.
The message with Action 'http://tempuri.org/IProcessManagementService/ListProcesses' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
I have attempted to remove all security requirements from the services, and used both wsHTTP and basicHTTP endpoints. Nothing appears to do the trick. The routing service is properly passing on the mex services, however, so svcutil is able to build client classes.
I am configuring the router though code. The routing service is given a list of service names to provide routing for, and the router and server addresses.
Here is the config for the routing service:
<MES.RoutingService.Properties.Settings>
<setting name="RouterAddress" serializeAs="String">
<value>http://localhost:8781/</value>
</setting>
<setting name="ServerAddress" serializeAs="String">
<value>http://10.4.1.117:8781/</value>
</setting>
<setting name="Services" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>ProcessManagementService</string>
<string>TestProcessService</string>
<string>ProcessDataEntryService</string>
<string>ProcessReportingService</string>
</ArrayOfString>
</value>
</setting>
</MES.RoutingService.Properties.Settings>
It calls a function with the following code, providing the router address, server address, and service names from the config file.
var routers = new List<ServiceHost>();
foreach (var service in _services)
{
var routerType = typeof(IRequestReplyRouter);
var routerContract = ContractDescription.GetContract(routerType);
var serviceHost = new ServiceHost(typeof (System.ServiceModel.Routing.RoutingService));
var serverEndpoints = new List<ServiceEndpoint>();
//Configure Mex endpoints
serviceHost.AddServiceEndpoint(routerType, MetadataExchangeBindings.CreateMexHttpBinding(), _routerAddress + service + "/mex");
serverEndpoints.Add(new ServiceEndpoint(routerContract, MetadataExchangeBindings.CreateMexHttpBinding(), new EndpointAddress(_serverAddress + service + "/mex")));
//RAR SECURITY SMASH.
var binding = new WSHttpBinding(SecurityMode.None);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
binding.Security.Message.EstablishSecurityContext = false;
binding.Security.Message.NegotiateServiceCredential = false;
binding.Security.Message.ClientCredentialType = MessageCredentialType.None;
//Configure WsHttp endpoints
serviceHost.AddServiceEndpoint(routerType, binding, _routerAddress + service);
serverEndpoints.Add(new ServiceEndpoint(routerContract, binding, new EndpointAddress(_serverAddress + service)));
var basicBinding = new BasicHttpBinding();
serviceHost.AddServiceEndpoint(routerType, basicBinding, _routerAddress + service + "/basic");
serverEndpoints.Add(new ServiceEndpoint(routerContract, basicBinding, new EndpointAddress(_serverAddress + service + "/basic")));
//Set Routing Tables
var configuration = new RoutingConfiguration();
configuration.FilterTable.Add(new MatchAllMessageFilter(), serverEndpoints);
serviceHost.Description.Behaviors.Add(new RoutingBehavior(configuration));
routers.Add(serviceHost);
}
return routers;
The service calls this function on start, and then opens each of the service hosts returned in the routers list.
The server itself is configured via the following app.config
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="noSecurityBinding">
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="MES.ProcessManagerServiceLibrary.ProcessManagementService">
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint binding="wsHttpBinding" bindingConfiguration="noSecurityBinding"
contract="MES.ProcessManagerServiceLibrary.IProcessManagementService" />
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""
contract="MES.ProcessManagerServiceLibrary.IProcessManagementService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8781/ProcessManagementService/" />
</baseAddresses>
</host>
</service>
<service name="MES.ProcessManagerServiceLibrary.TestProcessService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="noSecurityBinding"
contract="MES.ProcessManagerServiceLibrary.ITestProcessService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""
contract="MES.ProcessManagerServiceLibrary.ITestProcessService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8781/TestProcessService/" />
</baseAddresses>
</host>
</service>
<service name="MES.ProcessManagerServiceLibrary.ProcessDataEntryService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="noSecurityBinding"
contract="MES.ProcessManagerServiceLibrary.IProcessDataEntryService" />
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""
contract="MES.ProcessManagerServiceLibrary.IProcessDataEntryService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8781/ProcessDataEntryService/" />
</baseAddresses>
</host>
</service>
<service name="MES.ProcessManagerServiceLibrary.ProcessReportingService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="noSecurityBinding"
contract="MES.ProcessManagerServiceLibrary.IProcessReportingService" />
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""
contract="MES.ProcessManagerServiceLibrary.IProcessReportingService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8781/ProcessReportingService/" />
</baseAddresses>
</host>
</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>
</system.serviceModel>
What am I missing?
Edit: I think I found the problem- the routing service was returning this configuration for the services-
<client>
<endpoint address="http://shco-appsrv1.us.shepherd.ad:8781/ProcessManagementService/"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IProcessManagementService"
contract="IProcessManagementService" name="WSHttpBinding_IProcessManagementService" />
<endpoint address="http://shco-appsrv1.us.shepherd.ad:8781/ProcessManagementService/basic"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProcessManagementService"
contract="IProcessManagementService" name="BasicHttpBinding_IProcessManagementService" />
</client>
This points to the internal server, not the external server. No idea if this is standard behavior for a Routing service, or if it is overridable behavior.
Seems like you haven't wired-in the serviceModel client element in your config properly. The RoutingService needs to be configure like a standard WCF service and also expose "intercept" endpoints to the routed services. It then uses the client element endpoints to redirect the service calls.
Below is a simple config that doesn't rely on code. It contains naming conventions for the various routing values that keep everything straight. You can replace the "YourRoutedService" string in the config with your actual service name but the suffixes should remain to keep everything wired up correctly.
I would start with getting a file-based config successfully making end-to-end calls (no recompiles needed when tweaking with this approach). Next, base your code on the file config and remove the elements being code configured.
<system.serviceModel>
<services
name="System.ServiceModel.Routing.RoutingService"
behaviorConfiguration="RoutingBehavior" >
<endpoint
name="RouterEndpoint"
address=""
binding="wsHttpBinding"
bindingConfiguration="Http"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<!-- List all endpoints to be routed via EndpointName routing filter -->
<endpoint
name="YourRoutedServiceName"
address="YourRoutedService"
contract="System.ServiceModel.Routing.IRequestReplyRouter"
binding="wsHttpBinding"
bindingConfiguration="Http" />
</services>
<routing>
<filters>
<!-- Active filters -->
<filter
name="YourRoutedServiceFilter"
filterType="EndpointName"
filterData="YourRoutedServiceName" />
</filters>
<filterTables>
<filterTable name="WebLayer">
<!-- Map to client Endpoints-->
<add
filterName="YourRoutedServiceFilter"
endpointName="YourRoutedServiceNameEndpoint"
priority="0" />
</filterTable>
</filterTables>
</routing>
<behavior name="RoutingBehavior">
<routing routeOnHeadersOnly="false" filterTableName="WebLayer" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpsGetEnabled="true" />
</behavior>
<bindings>
<wsHttpBinding>
<binding name="Http">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
name="YourRoutedServiceNameEndpoint"
address="http://somehost/YourRoutedService/Service.svc"
contract="*"
binding="wsHttpBinding"
bindingConfiguration="Http" />
</client>
</system.serviceModel>

WCF .config file - something is plainly wrong

Folks,
I've got something wrong with this .config for my WCF. When I send data to it more than 8192 bytes (the default) it fails, telling me my "maxStringContentLength" is only 8192. I think I have it set here to 10,000,000.
Any clues?
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding" maxReceivedMessageSize="50000000" maxBufferPoolSize="50000000" messageEncoding="Mtom">
<readerQuotas maxDepth="200" maxStringContentLength="10000000" maxArrayLength="16384" maxBytesPerRead="10000000" maxNameTableCharCount="16384" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="PsychCoverage.WcfMT.Admin">
<endpoint address="" binding="wsHttpBinding" contract="PsychCoverage.Common.IAdmin">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfMT/Admin/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior >
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
You do have it set, but you're not referencing it in the endpoint element, so .NET is using the default for wsHttpBinding (8192). Add the config you specified using the bindingConfiguration attribute of the endpoint element:
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="PsychCoverage.Common.IAdmin">
Also, I'd recommend using a different name than wsHttpBinding to prevent confusion.

Server side WCF (.svc) service stops working after exception

I'm using a duplex ReliableSecureProfile in WCF and the server will stop listening to new requests if an exception occurs on any client.
How can I make the server more resilient to failures that happen to any single client? Everything works again if I restart the server or redeploy
My client code looks like this:
CustomBinding rspBinding = new CustomBinding();
rspBinding.Elements.Add(new ReliableSessionBindingElement());
rspBinding.Elements.Add(new MakeConnectionBindingElement());
rspBinding.Elements.Add(new TextMessageEncodingBindingElement());
rspBinding.Elements.Add(new HttpTransportBindingElement());
DuplexChannelFactory<IProcessDataDuplex> channelFactory =
new DuplexChannelFactory<IProcessDataDuplex>
(new CallbackHandler(), rspBinding, serviceAddress);
//
// The problem always occurs on this line.
//
reusableSW = new LC.Utils.WCF.ServiceWrapper<IProcessDataDuplex>(channelFactory);
My web.config looks like this:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="rspServiceBehavior">
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="http" port="80" />
<add scheme="https" port="443" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<!-- Reliable Secure Profile -->
<binding name="rspBinding">
<reliableSession />
<MakeConnectionBindingElement/>
<textMessageEncoding />
<httpTransport />
</binding>
</customBinding>
<netTcpBinding>
<binding portSharingEnabled="true" >
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<extensions>
<bindingElementExtensions>
<!-- Reliable Secure Profile -->
<add name="MakeConnectionBindingElement" type="Microsoft.Samples.ReliableSecureProfile.MakeConnectionElement, Microsoft.Samples.ReliableSecureProfile.MakeConnectionChannel" />
</bindingElementExtensions>
</extensions>
<services>
<!-- Reliable Secure Profile -->
<service behaviorConfiguration="rspServiceBehavior" name="Microsoft.Samples.ReliableSecureProfile.RSPService">
<endpoint binding="customBinding" bindingConfiguration="rspBinding"
contract="Microsoft.Samples.ReliableSecureProfile.IProcessDataDuplex"
listenUriMode="Explicit">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
</host>
</service>
<!--<service name="WcfTcpTest.Service1" >
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:1337/Service1/" />
</baseAddresses>
</host>
<endpoint address="" binding="netTcpBinding" contract="WcfTcpTest.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>-->
</services>
<protocolMapping>
<clear/>
<!-- removes all defaults which you may or may not want. -->
<!-- If not, use <remove scheme="http" /> -->
<add scheme="http" binding="customBinding" bindingConfiguration="rspBinding"/>
</protocolMapping>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="false"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
I can't reproduce this issue anymore (where the server simply stops responding). I think the issue is related to VS2010's desire to catch handled exceptions and stop all threads as explained here:
Getting an Unhandled Exception in VS2010 debugger even though the exception IS handled