Implementation Of A Real Time Web Service in ASP.NET

Manzoor Ahmed
A free video tutorial from Manzoor Ahmed
Microsoft Certified Trainer
4.3 instructor rating • 11 courses • 112,520 students

Learn more from the full course

The Complete ASP.Net Web Forms with ADO.Net From Scratch

Rapid Web Application Development Using Asp.Net

09:33:46 of on-demand video • Updated November 2015

  • Creating a project and running in web browser
  • Working with standard controls
  • Working with Data controls
  • Working with validation controls
  • Working with Master pages
  • Working with Navigation controls
  • Working with Login controls
  • Understanding session management technique.
  • Understanding web.config file and machine.config
  • Working with client side reports
  • Working with Datareader in Ado.Net
  • Working with Dataset in Ado.Net
English [Auto] Help in this demo I'm going to show you how to create a web service and then how to use that service in our application. So the creative service select is the dot net that services and does my age and go best lip service that means I'm going to create a web service which takes my day off but that is your month and day. And if it is written my age in base like on many days all I am so on with the kid that kind of service so I'll just say OK now whenever I start a web service is my solution explorer and have a service don't see a file by default and service dog is fine. And this is the file that I'm going to use and any code that will implement I'll be implementing my service dog. This is my service dog fight. Now this file contains a few names spaces that is system dog Web services. Now this is the namespace which supports web service methodes. So I have some class which inherits from the service class. So every service is derived from service class. Anything that I want to share I'll be sharing with the help of vetement and the service will be in the form of amateur light because in my view that service is nothing but a way of calling Mattos of one application some of it that means I'm going to create a method here. This method would be accessed or it would be called by some applications which are going to use this. So by default I have got. Hello world. So I leave this as it is. I'm going to be fine. And you've admitted that this is an attribute. Whenever I write this review it means that this method is exposed to the public. It is going to be done. Yes I'll take it and I'll say get my age in place. And here I need to pass three bad immigrants. The first parameter is B. That is indeed the next pyramidalis month I'll sit in the one more ear and it not in this matter. And we go by the logic of what he might eat in two days. So first of all I'll be getting a daytime object equal to NEW DAY time. And here I'm going to pass this three Banneker's that I'm trying to dig this tree into. And I'm trying to convert this big time object so I got it. We'll dig deep. Now what is that loop outfit. In case it was a great deal. At no time bought now Daut substract from current. I want to subtract my debt off but substract DP God I want the number of deaths of this time span is it. Now I got the this in my this little. I just set right return base that's it. My method is ready. That means this is amateur which is preparing for this day month year and all that I'm rebounders off by India and it is when you calculate all it is going to convert my good days and it is going to be done the number of days. That means so many years or now I'll just say this I'll believe this and I'll just set it at the start page and I like to it. So here is my study is fine. So it is me who matters when it's Halloween. I'll just click on this word on my head of what is available with me. And if you can see that I have soft messages I just invoke this. So it is written in the hello words tree. So it is an X similar format and I'll close this back and I'll click on it. My agent This shows me three X-boxes. So in the first X-Box I'll pass my day off. But they are six month seven year 1984. Now if the odds of my soap message format is something like this CD. So everybody completely misses as we have discussed in our earlier video message transfer takes place in the form of a sweet pea which you can simplify. So day one year trip home he doesn't got what they call three ex-MIL elements and the result is again an X similar element. So this is the next Semmel file. All I can say is so if the format message simply in what this is going to call my method and exit till they get the value and it'll show me something non-POD and Jane. Yeah I don't mind call them fine or find some nine point five not five days or so. This is my web service which is ready now I should use this service so I'll go back to my services if I want to use service then I should have the as well as we have discussing the view we are going to access them services with the help of the deal. So sort of his description language. I'll click on the description and see this this is mine that was D. So my web service is available in the form of the blue been. Now I simply copy this I'll minimize this and minimize this. Now go and I'll start a new Web site instead of a Web site. And then Limmer does use web service and say OK now my visa is ready. You can see this. This is what my web service is ready and I have full. You can say that you know if it is ready that means I have all stated I am not going to close this I'm not going to close my earlier visuals to do this service project because if I want to use this I need to host it on the server. So I lost no I do not have. I said what. So I'm keeping it on my local set of what so. Or does I just provide everybody your visual web developer. So I'm not going to close my earlier project I'm going to keep it open now and into my application if I want to use the service in my application. The very first step that I need to do is add this deal file to my project the whole way and select the product right click and say add reference I'll put you on it yet. And I was let go. It shows me who my cards get. My agent is an Alawite. Anyway we are going to get my engineers. It has got this is a method which takes three hours and becomes a single problem. And so I can name this as my age. The reference to it is going to add this reference to my project. That means it is going to have a reference to their tables in my project. You can just check this in the Quantic file. You can see in my age setting is not so obvious and it is reflooding good. And so you want it fine. Now my lip service is ready to use. Now I need to create in my application so I'll just take three text boxes and a button on this button click. I'll be calling my name. So I was able to click the button know what is that I need to do I need to create an object of sort of a class so any my services Glaus is not present in this project. It is present in my earlier project but I have added the reference so it is going to show me. Are you going to give me a proxy class even though classes are not present here. It looks like the glass is here. So how do you get that last. I should go for it using my age web service. Now before telling the object of the class and the values of three text boxes in three different variables. Now I got D. Not get the object of my first class service as equals and that is not disclosed as godless proxy class even though the service is not present here. In my current project it is present in my earlier project you can see the service classes for them here but I'm using it here. Why you go there. I don't think so it is giving me a proxy class because it has proxy class. Now that's got my aging base. So here I need to pass three but I'm with does D for this and for a month and Whiteford here. And it is going to read an integer variable. So I'll take that result in an audience that is not displayed that result on the label label one dot text equals two ideas dot to a string this legacy too. So in Fostex words every passing day. So six. And the second text box month. So that will deliver an entire text box that will be Nineteen Eighty-Four. And if I click the button I should get the result in my table and see that I haven't ever done that kind of logic in this. I have written my logic in my left side of his stall on the button. It is going to invoke the service and file strip out and does that get developed calculator does the value and it will display on the level. Click on the button that says this is very simple. The creative observers. This is what we need to do. We are going to see how to use a service which is the country and returns all the cities of that country. So here I'm not going to need the web service. We're going to use an existing web service. So for this unique internet connection and the service that we are going to use is the service x dot net slash global weather dot as Amex as I told you. We need that deal. So this is the biggest deal for that particular service. So I got the best deal for that service so I'll just call it this and I'll start my application in my question. I have a X-Box in which I'm going to write the condominium and I have a button get to is when I click the button to read me all the states or cities of that country. So what I need to go to an Explorer right click on this and as they add of a presence so here I'm going to say is that the best deal you are in. I'll just say go. So here we have two methods. One letter is get the city's bike on brie which is country name as a street and break down all the cities as a stream. And we have one more amateur and even we are not going to use this. But what is the use of this method is that city name and country name and it returns the report of all major cities around the world. So whatever the city name and country name will pass it will get us there. Whether that particular city. So my very name I'll just rename this as my cities that service address friends of friends got added. I was just going to get to these now using my city's Web service and in this we have a class called as global weather or a proxy class like you know what we do. We created a a set of is now in the same sense. This is the class global weather that was close to the new global weather. It did not get cities by country like this. I'll be passing the Potomac on a country name from my active DXP country door next door to a street. It is Windorah than me. A strange thing austerities so I'll simply say Spring City is close for now. I will write a response not try cities. So what is it I'm doing. I'm simply displaying all the space on my output screen of this executive. So I got my page in which I have a text box and it is Buttons. So you're on the right. The country named India. I'll keep going guess it is what it is going to do. It will take the spot in India and it will fall this back to the mid third get cities by country. Off my service that I'm using in my kitchen so I'll say get cities see that it is just plain mean. All the cities of country India India Hyderabad airport is the place where I am recording this really well right. In UK it is going to get me the cities of the UK if I tried. So the going to get me in the cities of Saudi Saudi Arabia. So this is very simple. I can use already existing web services in addition in this way. So thank you very much.