new york university computer science department courant ...instructor: jean-claude franchitti...
TRANSCRIPT
![Page 1: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/1.jpg)
New York University Computer Science Department
Courant Institute of Mathematical Sciences
Creating a Simple XML Web Service Using Visual Studio .Net
Course Title: XML for Java Developers Course Number: g22.3033-002 Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes VB.Net, C#.Net, and C++.Net). Creating a New Web Service Step 1: Open Microsoft Visual Studio.Net
Step 2: On the File menu, point to New, and click Project
![Page 2: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/2.jpg)
Step 3: In the New Project dialog box, do the following
a. In the Project Types pane, select Visual Basic Projects b. In the Templates pane, select ASP.NET Web Service
![Page 3: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/3.jpg)
c. In the Name box, type SimpleWebService as the name of your project
d. In the Location box, you can accept the default setting, which is
http://localhost, or you can enter a different URL
e. Click OK Step 4: In Solution Explorer, right-click the Service1.asmx file, and select View Code
![Page 4: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/4.jpg)
Step 5: Scroll down below the commented (green) text, and add the code shown to
calculate the sum of numbers
![Page 5: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/5.jpg)
Step 6: In Solution Explorer, right-click Service1.asmx, and click Set As Start Page
![Page 6: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/6.jpg)
![Page 7: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/7.jpg)
Step 7: Save the solution
Step 8: On the Build menu, click Build
![Page 8: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/8.jpg)
![Page 9: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/9.jpg)
Creating a Web Service Client Application Step 1: On the File menu, point to New, and click Project Step 2: In the New Project dialog box, do the following
a. In the Project Types pane, select Visual Basic Projects b. In the Templates pane, select ASP.NET Web Application
c. In the Name box, type WebApplication as the name of your project
d. In the Location box, you can accept the default setting, which is
http://localhost, or you can enter a different URL
e. Click OK
![Page 10: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/10.jpg)
Step 3: From the Web Forms tab of the Toolbox, drag and drop two TextBox controls, a
Label control, and a Button control to the Design page WebForm1.aspx, and arrange them to your liking
![Page 11: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/11.jpg)
Step 4: Right-click the Button control, and click Properties Step 5: In the Properties window, set the Text attribute to Calculate
![Page 12: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/12.jpg)
Step 6: Right-click the Label control, and click Properties Step 7: In the Properties window, clear the Text attribute to make this label blank
![Page 13: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/13.jpg)
Adding a Web Reference Step 1: On the Project menu, click Add Web Reference
![Page 14: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/14.jpg)
Step 2: In the Address box of the Add Web Reference dialog box, type the URL to the
.vsdisco file (i.e., http://localhost/SimpleWebService/SimpleWebService.vsdisco) of the Web Service you want to access or click on the Web Reference on Local Web Server link. When you obtain the discovery document, select the Web service you want in the Available reference box
![Page 15: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/15.jpg)
Step 3: Click Add Reference to add a Web reference for the target Web service. Accessing the Web Service Step 1: Double-click the Calculate button on WebForm1.aspx to create an event-handling
method for this button and to display the code-behind file. Then add the code shown below
Step 2: Select WebForm1.aspx in Solution Explorer
![Page 16: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/16.jpg)
Step 3: Right-click the WebForm1.aspx, and then select Set as Start Page on the shortcut
menu
![Page 17: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/17.jpg)
Step 4: Save the solution. Building and Testing the Web Service Client Application Step 1: On the Build menu, click Build
![Page 18: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/18.jpg)
Step 2: In Solution Explorer, right-click Webform1.aspx, and click View in Browser
![Page 19: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/19.jpg)
Step 3: In the two text boxes, type the numbers you want to multiply, and then click the
Calculate button
![Page 20: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/20.jpg)
![Page 21: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/21.jpg)
Testing A Farenheit to Degree Conversion Application
![Page 22: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/22.jpg)
![Page 23: New York University Computer Science Department Courant ...Instructor: Jean-Claude Franchitti Session: 9 Software Requirements Visual Studio .Net Beta 2, Service Patch 2 (includes](https://reader033.vdocuments.us/reader033/viewer/2022053004/5f083c927e708231d42102e4/html5/thumbnails/23.jpg)
Comparing with the IBM WSTK Address Book Sample