Example #1
0
        public IFavoriteLinkService GetProxy()
        {
            Trace.WriteLine("DataServiceClient: GetProxy");
            ChannelFactory <IFavoriteLinkService> factory =
                new ChannelFactory <IFavoriteLinkService>(String.Empty);

            IFavoriteLinkService proxy = factory.CreateChannel();

            return(proxy);
        }
Example #2
0
        public IFavoriteLinkService GetProxy()
        {
            Binding binding = new BasicHttpBinding();
            Uri     address = new Uri(serviceUri);

            ChannelFactory <IFavoriteLinkService> factory =
                new ChannelFactory <IFavoriteLinkService>(
                    binding,
                    new EndpointAddress(address));

            IFavoriteLinkService proxy = factory.CreateChannel();

            return(proxy);
        }
Example #3
0
        public void Test501_WcfTest()
        {
            // fill in the test links
            domain.SaveFavoriteLink(_profileId1, "http://abclink.com", "ABC Link");
            domain.SaveFavoriteLink(_profileId1, "http://deflink.com", "DEF Link");
            domain.SaveFavoriteLink(_profileId1, "http://ghilink.com", "GHI Link");

            StartDataService();
            IFavoriteLinkService proxy = GetProxy();

            FavoriteLinkDataContract[] links =
                proxy.GetLatest20FavoriteLinkCollection(_profileId1);

            Assert.IsTrue(links.Length == 3, "Array should have 3 links");
            Console.WriteLine("Links:");
            foreach (FavoriteLinkDataContract link in links)
            {
                Console.WriteLine(link.Url);
            }

            StopDataService();
        }
Example #4
0
 public void ResetProxy()
 {
     _proxy = null;
 }