public void Services_DifferentNamespaces_sameOperation()
        {
            var baseAddress = @"net.pipe://127.0.0.1/" + this.GetType().Name + MethodBase.GetCurrentMethod().Name;
            var serv = new ContractVersion1.Service();
            using (var host = new ServiceHost(serv, new Uri[] { new Uri(baseAddress) }))
            {
                var binding = new NetNamedPipeBinding();
                host.AddServiceEndpoint(typeof(ContractVersion1.IService), binding, baseAddress);

                host.Open();
                using (var channelFatory = new ChannelFactory<ContractVersion2.IService>(binding))
                {
                    var c = channelFatory.CreateChannel(new EndpointAddress(baseAddress));
                    c.Do();
                }
            }
        }
Example #2
0
        public void Services_DifferentNamespaces_differentOperations()
        {
            var baseAddress = @"net.pipe://127.0.0.1/" + this.GetType().Name + MethodBase.GetCurrentMethod().Name;
            var serv        = new ContractVersion1.Service();

            using (var host = new ServiceHost(serv, new Uri[] { new Uri(baseAddress) }))
            {
                var binding = new NetNamedPipeBinding();
                host.AddServiceEndpoint(typeof(ContractVersion1.IService), binding, baseAddress);

                host.Open();
                using (var channelFatory = new ChannelFactory <ContractVersion2.IService>(binding))
                {
                    var c = channelFatory.CreateChannel(new EndpointAddress(baseAddress));
                    Assert.Throws <ActionNotSupportedException>(() => c.Do2());
                }
            }
        }
        public void Services_DifferentNamespaces_sameOperation()
        {
            var baseAddress = @"net.pipe://127.0.0.1/" + this.GetType().Name + MethodBase.GetCurrentMethod().Name;
            var serv        = new ContractVersion1.Service();

            using (var host = new NDceRpc.ServiceModel.ServiceHost(serv, new Uri[] { new Uri(baseAddress) }))
            {
                var binding = new NDceRpc.ServiceModel.NetNamedPipeBinding();
                host.AddServiceEndpoint(typeof(ContractVersion1.IService), binding, baseAddress);

                host.Open();
                using (var channelFatory = new NDceRpc.ServiceModel.ChannelFactory <ContractVersion2.IService>(binding))
                {
                    var c = channelFatory.CreateChannel(new NDceRpc.ServiceModel.EndpointAddress(baseAddress));
                    c.Do();
                }
            }
        }
        public void Services_DifferentNamespaces_differentOperations()
        {
            var baseAddress = @"net.pipe://127.0.0.1/" + this.GetType().Name + MethodBase.GetCurrentMethod().Name;
            var serv = new ContractVersion1.Service();
            using (var host = new NDceRpc.ServiceModel.ServiceHost(serv, new Uri[] { new Uri(baseAddress) }))
            {
                var binding = new NDceRpc.ServiceModel.NetNamedPipeBinding();
                host.AddServiceEndpoint(typeof(ContractVersion1.IService), binding, baseAddress);

                host.Open();
                using (var channelFatory = new NDceRpc.ServiceModel.ChannelFactory<ContractVersion2.IService>(binding))
                {
                    var c = channelFatory.CreateChannel(new NDceRpc.ServiceModel.EndpointAddress(baseAddress));
                    c.Do();
                    Assert.Throws<ActionNotSupportedException>(() => c.Do2());
                }
            }
        }