Я пытаюсь настроить службу WCF, которая вызывается через MsmqIntegrationBinding, и получаю сообщение об ошибке

System.InvalidOperationException: Ошибка проверки MsmqIntegrationBinding. Служба не может быть запущена. Привязка MsmqIntegrationBinding не поддерживает сигнатуру метода для операции службы.

Я работаю в следующем примере Здесь Единственная настройка, которую я изменил, - это использование формата сериализации ActiveX.

Интерфейс

namespace MQTest
{
    //MSMQIntegrationBinding
    [ServiceContract]
    public interface IMQService
    {
        [OperationContract(IsOneWay = true, Action = "*")]
        void GetData(string value);
    }
}

Служба

 public class MQService : IMQService
    {
        public static void Main()
        {
            // Get base address from appsettings in configuration.
            Uri baseAddress = new Uri("http://localhost:8000/Test/Service");

            // Create a ServiceHost for the CalculatorService type and provide the base address.
            using (ServiceHost serviceHost = new ServiceHost(typeof (IMQService), baseAddress))
            {
                // Open the ServiceHostBase to create listeners and start listening for messages.
                serviceHost.Open();

                // The service can now be accessed.
                Console.WriteLine("The service is ready.");
                Console.WriteLine("The service is running in the following account: {0}",
                                  WindowsIdentity.GetCurrent().Name);
                Console.WriteLine("Press  to terminate service.");
                Console.WriteLine();
                Console.ReadLine();

                // Close the ServiceHostBase to shutdown the service.
                serviceHost.Close();
            }
        }
        [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
        public void GetData(string value)
        {
            Console.WriteLine(value);
        }
    }

App.config



    
        
            
                
                
            
        

        
            
                
                    
                
            
        
    

5
задан ScArcher2 22 April 2011 в 18:44
поделиться