public void InserisciLibro(string titolo, string autore, int?anno, string genereString) { 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(); client.InserisciLibro(titolo, autore, anno, genereString, _username); ((IClientChannel)client).Close(); } catch (Exception) { //doNothing } }