Пример #1
0
 public void SegnalaLibro(Libro libro)
 {
     try
     {
         BasicHttpBinding myBinding = new BasicHttpBinding();
         myBinding.MaxReceivedMessageSize = 2147483647;
         myBinding.MaxBufferSize          = 2147483647;
         EndpointAddress          myEndpoint       = new EndpointAddress(_addr);
         ChannelFactory <IUtente> myChannelFactory = new ChannelFactory <IUtente>(myBinding, myEndpoint);
         // Create a channel.
         IUtente           client = myChannelFactory.CreateChannel();
         SegnalazioneLibro segn   = new SegnalazioneLibro()
         {
             Username = _username,
             Libro    = _libro,
             Id       = 1
         };
         client.AddSegnalazioneLibro(segn);
         ((IClientChannel)client).Close();
     }
     catch (Exception)
     {
         //doNothing
     }
 }