Dev2.Controller.CommunicationControllerFactory.CreateController C# (CSharp) Method

CreateController() public method

public CreateController ( string serviceName ) : ICommunicationController
serviceName string
return ICommunicationController
        public ICommunicationController CreateController(string serviceName)
        {
            return new CommunicationController { ServiceName = serviceName };
        }

Usage Example

コード例 #1
0
ファイル: TestHelper.cs プロジェクト: ndubul/Chillas
 public static string ExecuteServiceOnLocalhostUsingProxy(string serviceName, Dictionary<string,string> payloadArguments)
 {
     CommunicationControllerFactory fact = new CommunicationControllerFactory();
     var comm = fact.CreateController(serviceName);
     var prx = new ServerProxy("http://localhost:3142", CredentialCache.DefaultNetworkCredentials, new TestAsyncWorker());
     prx.Connect(Guid.NewGuid());
     foreach (var payloadArgument in payloadArguments)
     {
         comm.AddPayloadArgument(payloadArgument.Key, payloadArgument.Value);
     }
     if(comm != null)
     {
         var messageToExecute = comm.ExecuteCommand<ExecuteMessage>(prx, Guid.Empty);
         if(messageToExecute != null)
         {
             var responseMessage = messageToExecute.Message;
             if(responseMessage != null)
             {
                 var actual = responseMessage.ToString();
                 return actual;
             }
             return "Error: response message empty!";
         }
         return "Error: message to send to localhost server could not be generated.";
     }
     return "Error: localhost server controller could not be created.";
 }
All Usage Examples Of Dev2.Controller.CommunicationControllerFactory::CreateController
CommunicationControllerFactory