Beispiel #1
0
        private static void SelectGenres()
        {
            ChinookServiceReference.ChinookWebServiceSoapClient service = new ChinookServiceReference.ChinookWebServiceSoapClient();

            Console.WriteLine("\nSelect Genres\n{");

            try
            {
                ChinookServiceReference.AuthenticationHeader authentication = new ChinookServiceReference.AuthenticationHeader();
                authentication.Username = "******";
                authentication.Password = "******";
                //authentication.Password = "";

                ChinookServiceReference.GenreDTO[] result = service.SelectGenres(authentication);
                foreach (ChinookServiceReference.GenreDTO genreDTO in result)
                {
                    Console.WriteLine("Id: {0} - Name: {1}", genreDTO.GenreId, genreDTO.Name);
                }
            }
            catch (SoapException exception)
            {
                Console.WriteLine("SOAP Exception");
                WriteException(exception);
            }
            catch (Exception exception)
            {
                WriteException(exception);
            }

            Console.WriteLine("}");
        }
Beispiel #2
0
        private static void HelloWorld()
        {
            ChinookServiceReference.ChinookWebServiceSoapClient service = new ChinookServiceReference.ChinookWebServiceSoapClient();

            Console.WriteLine("\nHello World\n{");

            try
            {
                string s = service.HelloWorld();
                Console.WriteLine(s);
            }
            catch (SoapException exception)
            {
                Console.WriteLine("SOAP Exception");
                WriteException(exception);
            }
            catch (Exception exception)
            {
                WriteException(exception);
            }

            Console.WriteLine("}");
        }