Ejemplo n.º 1
0
        private void SendAddress_Click(object sender, RoutedEventArgs e)
        {
            using (ChannelFactory <IWCFServiceContract> factory = new ChannelFactory <IWCFServiceContract>("MyWCFClientNetTcp"))
            {
                //factory.Credentials.Windows.ClientCredential.UserName = "******";
                //factory.Credentials.Windows.ClientCredential.Password = "******";

                //var x = factory.Credentials.UserName;
                //  x.UserName = "******";
                //  x.Password = "******";


                IWCFServiceContract proxy = factory.CreateChannel();

                var ad = new LibServiceConfiguration.Contracts.Adress();
                ad.PostalCode   = "23879";
                ad.Street       = "Wasserkrüger Weg";
                ad.StreetNumber = "109";
                ad.City         = "Mölln";
                proxy.CreateAddress(ad);

                ad              = new LibServiceConfiguration.Contracts.Adress();
                ad.PostalCode   = "23879";
                ad.Street       = "Hauptstrasse";
                ad.StreetNumber = "17";
                ad.City         = "Mölln";
                proxy.CreateAddress(ad);


                MessageBox.Show("sent 2 addresses");
            }
        }
Ejemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            using (ChannelFactory <IWCFServiceContract> factory = new ChannelFactory <IWCFServiceContract>("MyWCFClientHTTP"))
            {
                //factory.Credentials.Windows.ClientCredential.UserName = "******";
                //factory.Credentials.Windows.ClientCredential.Password = "******";

                IWCFServiceContract proxy = factory.CreateChannel();



                var ad = new LibServiceConfiguration.Contracts.Adress();
                ad.PostalCode   = "23879";
                ad.Street       = "Mühlenstraße";
                ad.StreetNumber = "35";
                ad.City         = "Mölln";
                proxy.CreateAddress(ad);

                ad              = new LibServiceConfiguration.Contracts.Adress();
                ad.PostalCode   = "23879";
                ad.Street       = "Feuergräfen Straße";
                ad.StreetNumber = "11";
                ad.City         = "Mölln";
                proxy.CreateAddress(ad);

                var x = proxy.GetMessage();
                MessageBox.Show(x);
            }
        }