Exemplo n.º 1
0
        public void WcfConsume()
        {
            //string result = EgeeProxy.testWcf();
            SappelServiceClient sappelServiceClient = new SappelServiceClient(SappelServiceClient.EndpointConfiguration.BasicHttpBinding_ISappelService);
            InitResponse        initResponse        = sappelServiceClient.InitAsync(new InitRequest()).Result;
            GetVersionResponse  getVersionResponse  = sappelServiceClient.GetVersionAsync(new GetVersionRequest()).Result;

            Assert.IsNotNull(getVersionResponse.GetVersionResult);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget());
            ILogger log = LogManagerFactory.DefaultLogManager.GetLogger <Program>();

            log.Trace("1 - Création client WCF");

            SappelServiceClient sappelServiceClient = new SappelServiceClient("BasicHttpBinding_ISappelService");

            InitResponse       initResponse       = sappelServiceClient.InitAsync(new InitRequest()).Result;
            GetVersionResponse getVersionResponse = sappelServiceClient.GetVersionAsync(new GetVersionRequest()).Result;

            sappelServiceClient.Close();

            System.Console.WriteLine(getVersionResponse.GetVersionResult);
            System.Console.ReadLine();
        }
Exemplo n.º 3
0
        public static string testwcf()
        {
            //LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget());
            //ILogger log = LogManagerFactory.DefaultLogManager.GetLogger<EgeeProxy>();

            //log.Trace("1 - Création client WCF");

            //ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();
            //Task<string> response = client.GetDataAsync(3);
            //string result = response.Result;
            SappelServiceClient sappelServiceClient = new SappelServiceClient(SappelServiceClient.EndpointConfiguration.BasicHttpBinding_ISappelService);

            //log.Trace("2");

            InitResponse initResponse = sappelServiceClient.InitAsync(new InitRequest()).Result;
            //log.Trace("3");

            GetVersionResponse getVersionResponse = sappelServiceClient.GetVersionAsync(new GetVersionRequest()).Result;

            //log.Trace("4");

            return(getVersionResponse.GetVersionResult);
        }
Exemplo n.º 4
0
 public SappelServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(SappelServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Exemplo n.º 5
0
 public SappelServiceClient(EndpointConfiguration endpointConfiguration) :
     base(SappelServiceClient.GetBindingForEndpoint(endpointConfiguration), SappelServiceClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }