Web Services / Utilizing a Web Service
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
Now let's take web services one step further and let's actually utilize them in a .NET VB application without ever using XML and I want to show you this. This is just phenomenal; I'm going to open a windows application. And when this opens up, I'm going to show you a couple of easy steps that we do to begin to use this. Now I mentioned earlier, visual studio creates a proxy object that allows us to communicate with web services without dealing with XML at all. We use them programmatically, and so the first thing I'm going to do is - I'm going to drop a button onto this form, and I'll bring it to the middle, and now I'm going to add a reference. I'm going to add a web reference to the web service that's out there, notice there it is - AddThis/Service1 - and it shows me my two methods over here that are in it and then I click on Add Reference, and I just added the reference to this particular project. Now I'm going to double click on Button1, one thing I need to do is add or import the namespace. So I'm going to do - System.Web.services - now that lets me get to the web services and now on my button click, what I'm (going to do) is, I'm going to - Dim a As New - and then I'll put - leesburglt - that's the name of my web server, and it saw that web reference - service1. And now if I type A, you'll notice that it's bringing the web service to me. And here's these, a method. Now what I want to do is I want to pass this thing 25 and 40. To make this thing really show up good, I'm going to put a message box; so what's going to happen is when I click on this button, I'm going to call this web service and then return it to a message box. So let's run this thing, it will take it a minute to load up here; and you'll notice over here on the right, web references, I have a reference to leesburglt, and if I expand that you'll see the services, the disco files and the WSDL files. But anyway here's my form and I'm going to click on the button, and it goes out and then will return this data in the message box. And there it is: 65 is the total. Will return this data in the message box. And there it is: 65 is the total. [Duplication] And so you see I just used the web service without ever touching XML, SOAP, HTTP or anything. And that's as easy as they are. So that's web services, be sure and use them up. This is a unique way to add functionality across an enterprise, across the Internet, wherever. So again stick these in your toolbox and go for it.
Tutorial Information
| Course: | Microsoft Visual Basic .NET |
| Author: | Mark Long |
| SKU: | 33433 |
| ISBN: | 1932072349 |
| Release Date: | 2003-05-27 |
| Duration: | 6 hrs / 87 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 