コード例 #1
0
        public List <Libro> CercaGenere(string genereString)
        {
            List <Libro> libri = null;

            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();
                libri = client.CercaGenere(genereString).ToList <Libro>();
                ((IClientChannel)client).Close();
            }
            catch (Exception)
            {
                //doNothing
            }
            return(libri);
        }