Visual Basic.NET Comprehensive Concepts and Techniques Chapter 12 Creating Console Applications, Understanding XML, and Creating Web Services.

Slides:



Advertisements
Similar presentations
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel PivotTable List Feature Creating a PivotTable List Web Page Using Excel.
Advertisements

Creating and Editing a Web Page Using Inline Styles
Using Advanced Cascading Style Sheets
Chapter 5 Creating an Image Map
Using Macros and Visual Basic for Applications (VBA) with Excel
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Excel Web Feature Creating Static and Dynamic Web Pages Using Excel.
Microsoft Office 2007 Excel Web Feature Creating Web Pages Using Excel.
Microsoft Office 2007 Excel Web Feature Creating Web Pages Using Excel.
Creating and Editing a Web Page
Microsoft Windows Vista Chapter 5 Personalize Your Work Environment.
Creating a Form on a Web Page
Microsoft Office 2007 Word Web Feature Creating Web Pages Using Word.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 7 Creating an Online Form.
Microsoft Office 2007 PowerPoint Web Feature Creating Web Pages Using PowerPoint.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t PowerPoint Web Feature Creating a Presentation on the Web Using PowerPoint.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
Office 2003 Introductory Concepts and Techniques, 2 nd Edition M i c r o s o f t Windows XP Project Introduction to Microsoft Windows XP and Office 2003.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Office XP Introductory Concepts and Techniques Windows XP Edition M i c r o s o f t Windows XP Project An Introduction to Windows XP Professional and Office.
Microsoft Office 2007 Word Integration Feature Linking an Excel Worksheet and Chart to a Word Document.
HTML Comprehensive Concepts and Techniques Third Edition Project 3 Creating Web Pages with Links, Images, and Formatted Text.
Creating Tables in a Web Site
HTML, XHTML, and CSS Chapter 12 Creating and Using XML Documents.
Microsoft Office 2007 PowerPoint Web Feature Creating Web Pages Using PowerPoint.
Creating and Editing a Web Page using HTML IMED1316.
Creating and Editing a Web Page Project 2. Project Objectives Project 2: Creating and Editing a Web Page 2 Identify elements of a Web page Start Notepad.
Lecture #2: Using your computer Learning about the Windows XP Operating System.
Microsoft Windows Vista Chapter 1 Fundamentals of Using Microsoft Windows Vista.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Integration Feature Object Linking and Embedding (OLE) and Web Discussions.
HTML, XHTML, and CSS Chapter 8 Adding Multimedia Content to Web Pages.
Microsoft Windows 7 Part 1 Fundamentals of Using Windows 7.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
HTML Comprehensive Concepts and Techniques Third Edition 2 nd Project Creating and Editing a Web Page.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Project 2 Working on the Windows XP Desktop Windows XP Service Pack 2 Edition Comprehensive Concepts and Techniques.
HTML Concepts and Techniques Fourth Edition Project 5 Creating an Image Map.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
HTML Concepts and Techniques Fifth Edition Chapter 4 Creating Tables in a Web Site.
Microsoft Office 2010 is the newest version of Microsoft Office, offering features that provide users with better functionality and easier ways to work.
1 After completing this lesson, you will be able to: Get around the Internet with your browser. Connect to the Internet. Print Web pages. Save Web pages.
Creating and Editing a Web Page
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
XP New Perspectives on Microsoft Windows XP Tutorial 2 1 Microsoft Windows XP Working with Files Tutorial 2.
Creating and Editing a Web Page Using Inline Styles
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Integrating Office 2003 Applications and the World Wide Web
Getting Started with Application Software
PowerPoint Web Feature
Creating and Using a Database
Integrating JavaScript and HTML
Objectives Use Help and Support Copy, move, rename, and delete files
Creating Tables in a Web Site
Project 5 Creating an Image Map.
Accessing Databases with ADO.NET, Handling Exceptions, and Printing
Working on the Windows XP Desktop
Introduction to Internet Explorer
Using Windows XP Explorer
Shelly Cashman: Microsoft Windows 10
Presentation transcript:

Visual Basic.NET Comprehensive Concepts and Techniques Chapter 12 Creating Console Applications, Understanding XML, and Creating Web Services

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 2 Objectives Start a new Console application Use parameters in a Console application Write code to create a comma-delimited text file Write code to create a tab-delimited text file Write code to create an XML file

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 3 Objectives Start a new ASP.NET Web service application Understand the structure of XML files Write code to read an XML file Use a Web service in code Debug Console applications and Web services

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 4

5 Starting Visual Basic.NET and Adding a New Public Procedure to a Module Insert the Data Disk in drive A. Start Visual Basic.NET. When the Start Page appears, click the Open Project button on the Start Page If necessary, click the Look in box arrow and then click 3½ Floppy (A:). Double-click the Chapter12 folder Double-click the Compensation Review folder. If necessary, click the Compensation Review solution file (Compensation Review.sln) Click the Open button. When the Compensation Review project appears in the Solution Explorer window, double- click the UpdateCompensation.vb module

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 6 Starting Visual Basic.NET and Adding a New Public Procedure to a Module Type lines 28 through 42, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 7 Building, Saving, and Documenting the Class Library Right-click the Compensation Review project in the Solution Explorer window. When the shortcut menu appears, click the Build command Click the UpdateCompensation.vb tab in the main work area. Use the Print command on the File menu to print a record of the code for the UpdateCompensation.vb module

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 8 Starting a New Console Application Project Right-click the Compensation Review solution in the Solution Explorer window. When the shortcut menu appears, click the Add command. When the Add submenu appears, click the New Project command When the Add New Project dialog box appears, click the Console Application icon in the Templates area. Select the text in the Name box. Type CompensationUpdateProcessing in the Name box Click the OK button

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 9 Starting a New Console Application Project Right-click the References folder in the CompensationUpdateProcessing project in the Solution Explorer window. When the shortcut menu appears, use the Add Reference command to add a reference to the Compensation Review.dll component located in the A:\Chapter12\Compensation Review\Compensation Review\bin folder Right-click the Module1.vb module in the Solution Explorer window. When the shortcut menu appears, click the Rename command. Type CompensationUpdateProcessing.vb as the new module name

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 10 Entering Initial Console Application Code Enter lines 1 through 4, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 11 Entering Code to Validate Command-Line Arguments Enter lines 7 through 10, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 12 Entering Code to Determine the Type of File to Create Type lines 11 through 20, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 13 Creating and Opening a Text File Type lines 23 through 40, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 14 Writing to a Text File Type lines 37 through 53, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 15 Creating and Writing to XML Files

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 16 Creating and Writing to XML Files

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 17 Creating and Opening an XML File Type lines 60 through 72, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 18 Formatting and Initializing an XML Object Type lines 68 through 72, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 19 Writing an XML Element with an Attribute Type lines 73 through 79, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 20 Writing an XML String Element with No Attributes Type lines 80 and 81, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 21 Writing the Final XML Elements for Hourly Employee Data Type lines 83 through 92, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 22 Writing Salaried Employee Data and Closing the XmlTextWriter Object Type lines 94 through 116, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 23 Setting the Startup Project and Command-Line Arguments for Testing Right-click the CompensationUpdateProcessing project in the Solution Explorer window Click the Set as Startup Project command on the shortcut menu Click the Property Pages button in the Properties window. When the CompensationUpdateProcessing Property Pages dialog box appears, click the Configuration Properties folder Type /x 07/30/2005 in the Command line arguments box Click the OK button

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 24 Setting the Startup Project and Command-Line Arguments for Testing

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 25 Building, Saving, and Testing the Console Application Right-click the CompensationUpdateProcessing project in the Solution Explorer. When the shortcut menu appears, click the Build command Click the Start button on the Visual Basic.NET Standard toolbar Minimize the Visual Basic.NET window. Click the Command Prompt command on the Accessories menu of the Windows Start menu. When the Command Prompt window appears, type A: and press the ENTER key. Type cd\Chapter12\Compensation Review\CompensationUpdateProcessing\bin to change the current folder to the location of the executable file for the CompensationUpdateProcessing application

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 26 Building, Saving, and Testing the Console Application Type CompensationUpdateProcessing /t 07/30/2005 and press the ENTER key. Using the Windows Notepad application, open the file, A:\Chapter12\CompensationUpdate.txt, on the Data Disk Close the Notepad application. In the Command Prompt window, type CompensationUpdateProcessing /c 07/30/2005 and press the ENTER key. Type CompensationUpdateProcessing /r and press the ENTER key

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 27 Building, Saving, and Testing the Console Application Using the Windows Notepad application, open the file, A:\Chapter12\CompensationUpdate.txt on the Data Disk Close the Notepad application. In the Command Prompt window, type CompensationUpdateProcessing/x 07/30/2005 and press the ENTER key Using the Open command on the File menu of the Notepad application, open the file, A:\Chapter12\CompensationUpdate.xml on the Data Disk Click the Close button on the Notepad application window title bar. Click the Close button on the Command Prompt application window title bar. Maximize the Visual Basic.NET application

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 28 Documenting the Console Application Use the Print command on the File menu to print a record of the code for the Console application

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 29 Creating a Web Service

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 30 Starting a New ASP.NET Web Service Project Right-click the Compensation Review solution in the Solution Explorer window. When the shortcut menu appears, click the Add command. When the Add submenu appears, click the New Project command When the Add New Project dialog box appears, click the ASP.NET Web Service icon in the Templates area. Select the text, WebApplication1, in the Location text box. Type CompensationUpdateService in the Location box

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 31 Starting a New ASP.NET Web Service Project Click the OK button Right-click the Service1.asmx file in the Solution Explorer window. When the shortcut menu appears, click the Rename command. Enter CompensationUpdateService.asmx as the new file name Click the click here to switch to code view link in the main work area

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 32 Starting to Code a Web Service Type lines 1 through 3 and modify line 5, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 33 Declaring a Function in a Web Service Select lines 43 through 51 in the code window and then press the DELETE key. Type lines 43 through 45, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 34 Reading and Processing an XML Document Type lines 44 through 55, as shown below:

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 35 Saving and Testing the Web Service Click the Save All button on the Standard Toolbar. Right-click the CompensationUpdateProcessing project in the Solution Explorer window. When the shortcut menu appears, click the Set as Startup Project command Click the Start button on the Visual Basic.NET Standard toolbar Click the GetCompensationUpdate link Click the Invoke button

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 36 Saving and Testing the Web Service Click the Close button on both the Microsoft Internet Explorer application window title bars. If necessary, click the Visual Basic.NET taskbar button to display the Visual Basic.NET window. If necessary, close the Output window

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 37 Documenting the Web Service and Quitting Visual Basic.NET Use the Print command on the File menu to print a record of the code for the CompensationUpdateService Web service Click the Visual Basic.NET Close button

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 38 Summary Start a new Console application Use parameters in a Console application Write code to create a comma-delimited text file Write code to create a tab-delimited text file Write code to create an XML file

Chapter 12: Creating Console Applications, Understanding XML, and Creating Web Services 39 Summary Start a new ASP.NET Web service application Understand the structure of XML files Write code to read an XML file Use a Web service in code Debug Console applications and Web services

Visual Basic.NET Comprehensive Concepts and Techniques Chapter 12 Complete