Multiple Distributed WCF Services Identical Data Contract but Different Concurrency RRS feed

  • Question

  • I have a system which Asynchronously transports files to different WCF Services, those services have identical data contracts and namespace, however the underlying behavior of each is different. The switching process works as shown in the code below. The problem I have is that some of the services need to handle multiple concurrent connections, and others can only handle one connection at a time due to non thread safe underlying code.

    What is a good way to handle this situation ?

    WSHttpBinding binding = new WSHttpBinding();
                binding.Security.Mode = SecurityMode.Message;
                binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;

    //Note Trans.ServiceURI is a database generated dynamic value, based on specific business requirements.

    EndpointAddress remoteAddress = new EndpointAddress(new Uri(trans.ServiceURI), EndpointIdentity.CreateSpnIdentity("IntentionallyHidden")); //Endpoint specified by database
                    Console.WriteLine(getTimeDate() + "Configuring endpoint binding");

                    EPSVC.EAIEndpointServiceClient proxy = new EPSVC.EAIEndpointServiceClient(binding, remoteAddress);
                    EPSVC.TransactionItemsComposite stuffToProcess = new EPSVC.TransactionItemsComposite();
                    //client.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback);
                    proxy.SubmitCompleted += proxy_SubmitCompleted;


    proxy.SubmitAsync(stuffToProcess, trans);

    Thursday, March 12, 2015 11:04 AM


All replies