Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Below Service is Hosted in IIS with WSHTTPBinding
Service Code
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single, AddressFilterMode = AddressFilterMode.Any)]
   public class Service1 : IService1
   {}
  [OperationBehavior(TransactionScopeRequired = true)]
  public File_Data CopyFile(File_Data oFileData)
  {}



Call Service

   #region ..... Binding Configuration .....

                _binding = new WSHttpBinding();
                _binding.SendTimeout = new TimeSpan(0, 30, 0);
                _binding.ReceiveTimeout = new TimeSpan(0, 30, 0);
                _binding.OpenTimeout = new TimeSpan(0, 30, 0);
                _binding.CloseTimeout = new TimeSpan(0, 30, 0);
                _binding.MaxBufferPoolSize = Int32.MaxValue;
                _binding.MaxReceivedMessageSize = Int32.MaxValue;
                _binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
                _binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
                _binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
                _binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
                _binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
                _binding.Security.Mode = SecurityMode.None;
                _binding.TransactionFlow = true;
                //_binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;


                #endregion

                #region .... End point Configuration ....

                _endpoint = new EndpointAddress(VirtualDir+ "\\" + "Service1.svc");

                #endregion

<pre> public File_Data Copy_File(File_Data objFile_Data)
        {
            ChannelFactory<IService1> Channel = null;
            try
            {
                Channel = new ChannelFactory<IService1>(_binding, _endpoint);
                IService1 proxy = Channel.CreateChannel();
                objFile_Data = proxy.CopyFile(objFile_Data);
            }
            catch (Exception ex)
            {
                msgError = ex.Message;
            }
            finally
            {
                if (Channel != null)
                {
                    Channel.Close();
                    Channel.Abort();
                }
                Channel = null;
            }
            return objFile_Data;
        }





when the Service is called from multiple client it takes time to complete the operation
how i can configure the Service behavior to improve the performance of service

What I have tried:

tried changing the
[ServiceBehavior]
Posted
Updated 20-Nov-18 17:08pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900