Exemplo n.º 1
0
        private List <BookTitle> GetBookTitles()
        {
            // TODO: Build a uri for getting book titles

            // TODO: Create a web client and add a header for xml content

            // TODO: Get xml string containing book titles and isbn numbers
            string xmlStr = null;

            // Parse the xml to get a List<BookTitle>
            return(BookTitle.ParseTitles(xmlStr));
        }
Exemplo n.º 2
0
        private List <BookTitle> GetBookTitles()
        {
            // Build a uri for getting book titles
            Uri uri = new Uri(Settings.Default.SvcBaseAddress + "/titles");

            // Create a web client and add a header for xml content
            WebClient client = new WebClient();

            client.Headers.Add("Content-Type", "application/xml; charset=utf-8");

            // Get xml string containing book titles and isbn numbers
            string xmlStr = client.DownloadString(uri);

            // Parse the xml to get a List<BookTitle>
            return(BookTitle.ParseTitles(xmlStr));
        }