Udemy

What is WSDL? Importance of it in Webservices

A free video tutorial from Rahul Shetty
Teacher over 800K+ QA Students|Founder of RahulShettyAcademy
Rating: 4.6 out of 5Instructor rating
29 courses
868,008 students
What is WSDL? Importance of it in Webservices

Learn more from the full course

WebServices/Rest API Testing with SoapUI +Real time Projects

"Most Popular #1 SoapUI Test automation Course - "70,000+ students learning together with great collaboration"

12:37:51 of on-demand video • Updated July 2023

At the end of this Course you will get complete knowledge on Web services,API and their functionality
You will learn How to test Webservices and REST API using SoapUI
You will be able to develop robust Automation scripts for all the API tests using SoapUI features
You will learn new language called groovy to automate webservices with SoapUI inbuilt methods
You will be able to develop robust automation Framework forAPI's testcases
You will understand the importance and procedure of Mocking the webservices
You will learn basic sql concepts and procedure for database testing using SoapUI
Will get clear picture on Security Testing using SoapUI
You will understand how to generate neat reports for execution results
English [Auto]
Welcome back. So what is wisdom? Okay, so this model is an XML document that describes a web service. Okay, let's again take one practical scenario and first do that and then you will simply understand this definition. Okay, So I don't want to just read a definition like that and continue. We need to understand in practical. Right. Let me go back to this notepad again. Okay, so you are working in a company and you are in the role of API tester. So Client told us that, hey, you need to use Hotels.com APIs to actually display hotels in our website. You need to test that. That's what your client told you. But what is that web service? Like what operations that Hotels.com exposes. Okay. So that you need to know, right? So when I say what operations like here, if you want to display hotels, you are sending Paris this information to your Web service. Okay? Web service is nothing but collection of operations. Web service have a multiple operations inside it. One operation could be let me write it here. Okay. So one operation could be search hotels. With destination name. I'll start writing it here so that it will be very clear for you. I can take the notes here. Right. I can put a bullet points such hotels. Okay. Okay, this could be one operation. So basically when you send a soap request to this operation. Okay. So in web service only, they will have multiple operations. So one functionality which you require is get me the hotel details with destination time. So this operation invokes that particular code in their official website and displays you all the hotels. Okay. There could be another operation which also gives us that search. Cars, rental cars with destination. Let's say that hotels.com also provide that feature. That could be another operation. So now when you are British Airways wants a rental car information. So they will actually hit this particular operation in that Web service. Okay. So when when I say we will take the help of Web service to display, that doesn't mean that we hit this Web service directly. First, we reach this end point. And we need to also provide which operation you want to invoke with the soap message what you are sending. Okay, So Web service will not accept any soap messages. It will receive it and it will redirect to one of its operation. Okay. That we have to provide in our soap message, in our soap protocol itself, we have to provide for which operation we are sending our message. Okay. So in that way, when Web service reads your soap message, it will see that particular operation and redirect you to that specific thing. And another thing could be, um, search destination packages. Okay. For tour. With the provided details. This could be one operation. So basically service comes under with multiple operations now. So when your client say use exact, use their web services and test all the web services given by Hotels.com. So that's your requirement. Okay. Or maybe you are a part of Hotels.com ID. Okay. You are a Hotels.com senior test engineer. We are working as a senior test engineer in this company and this company manager reaches out to you and said that we were actually having some web services with multiple operations. We are sharing this web service with a lot of clients like British Airways, Etihad, Emirates, so many clients. So we need to make sure that we have we are sending a right Web services. So basically you have to test and provide the results to your manager. So what do you ask to your manager when he simply say, go and test our Web service? Where will you start? Okay, This is a real challenging question. When you sit in your role now, you have understood something like what is web service, what is soap, what is rest? But when someone says you go and test our web services, if they ask like that in a generic statement, what do you do? So you should ask some details to your client, right? So basically you have to ask what is the contract of the Web service? Okay. You have to ask. Give me the contract of the web service so that I will go and test it. You have to start like this. So what is the contract of the soap web service? Okay For soap web services, the contract we will generally call as a Wsdl file. Okay. Wsdl stands for Web Services Description Language. Okay. That actually describes the web services. So when you when client share you the contract of that soap, which is nothing but Wsdl from that Wsdl, we will know what all operations that particular web services is supporting and what are the soap standards which it should receive And all the information, the complete information about that particular web service will be known in Wsdl file. Okay. Without Wsdl file, you cannot go and test anything. Okay, so even if you want to test in your soap UI tool, it will first ask Give me the Wsdl file. Okay, so you have to import this Wsdl file in your soap UI tool to start testing. If you don't have this, then you cannot test because you never know what to test. Right? All those testing, what to test, what operations are available? What parameters does operation expects? Everything is provided in the contract of web service, which is nothing but Wsdl file. So this is a heart for soap web services. Okay, so right now we are focusing on soap web services only in rest. There is a different style, which I will be talking later. So for now, just focus on this. So for this soap Web services, the Wsdl stands as a heart. Okay. Now, let me take you one example of how wisdom looks like. It's a complicated XML document. Okay, but you need not worry, as I said. So your tool is there for us to break down all those complicated XML and it will provide neatly UI for us to show what our operations from that Wsdl file and what soap message it is expecting everything soap UI tool clearly gives us. Okay, if you just pass this Wsdl contract to soap UI, it will take that headache of interpreting that complicated XML and it will simply provide a neat operations in that tool. Okay. So that's why we depend upon soap UI tool. Now I'll take you one example of showing how this looks like. Okay, let me take calculator web service example. Yeah. When you search calculator web service, you have something like DMU Online.com. So this is a sample web service hosted on this website. Okay. So let's read and understand the following operations are supported. So that means there is a calculator web service there, just like the Web service. What we are talking here. It's that Hotels.com web service. So here operations available are search hotels with destination name, search, rental course, search destination packages. These are three operations available. So in calculator web service operations available are add, divide, multiply and subtract. So that means you need not worry about adding code in your test. If you send simply two integers to this operation of calculator web service, this will connect to its calculator code and sum up two values and give back response of that sum to you back. Okay, so if you send two comma three from your website to this calculator web service to add operation two plus three, it calculates Phi is an output. Okay? This operation, this service Web service will actually talk to its core calculator code and get the value back phi and it prints Phi back to your website. Okay. So these are operations available just like what we have here. So Web services, as I said, have collection of operations. So these guys are clearly noted there. But in real time when you are working, people or developers may or may not provide this information, but they will give you the contract, which is nothing but visible. So for this calculator, where is the contract? Here it is. Please review the service description, which is nothing but visible if you select this. Yeah. This is your contract. Okay. Just don't get panicked by looking at this. It's very simple. If you just import this complete document in your soap UI tool and then you will see how cool it gives your results back. Okay. Which we will be doing in the very next lecture and coming 1 or 2 lectures. Don't worry. Okay. So I will actually minimize things to explain this Wsdl file in high level. Okay. There is no point for you to learn depth of each and every line because that is specific to developers point of view. But still you need to understand some things here. Okay, so if you read this, I have minimized everything here binding. Okay, so calculator binding is a term which will actually help you to see how many operations it supports. Okay. When someone gives you a Wsdl file and if you don't have soap tool with you, and if they ask you to identify how many operations this web service provides, you can simply come to the binding and open this. Okay, So this hotels.com guy, if you want to connect to the British Airways, he will simply give this contract to British Airways. That's all. He will not give any code or infrastructure. He will just give this dump, XML file contract and say, okay, go and utilize all my operations and get the details from my code without taking headache of integrating. So this complete Wsdl developers will take and then they will use respective soap operations to retrieve results and to publish their website. So that's how developers work. So all we need is a contract of service. Okay. So if I open this, if you minimize there are four operations here. Add, subtract, multiply and divide. Okay. So open one operation. Let me minimize input. Okay. So it's saying so one, two operation. And if you open this, it will say add operation. Name is at. Right. So it is expecting input and it's expecting output. So when you say Operation Name is Add, then go back to the types here types attribute which actually describes the parameters which add operation is expecting. Okay, when there is an operation like this. Like such destination packages. So you need to provide some parameters, right, to get the results. So what parameters you need to pass like three day package, five days package, ten days package. So based upon your inputs, it can talk it to their official code and give you the results that input what you need to send. How will you know? Okay if British if hotels.com guys simply provides this operations, how will you know what inputs you have to pass to this operations and get response? That information will be in this Wsdl file only. So if you see Operation Name add in this binding, come back to types. Okay, minimize this. If you minimize it, will be easy to understand. If not, so many things will make you look complicated. Okay, so here type is at name equals to operation. Name is at right for Operation Name. And if you open this it is expecting two integers integer. A integer B so that means two values need to be passed for add operation. That's true, right? If you want to add, you have to pass two values two three, then it will give you five. So that's what it is saying. So even in hotels.com, you will get binding like this. Okay, so when you see the operation name, go back and check out the types attribute in that. If you open, you will see what exactly you need to send. For operation, but in real time. Just don't get panic. You will not at all. Look at this. You will simply import this in your soap UI tool and your soap UI tool will give that all the details. Okay, so that's very easy. So you will not really bother about all this. You will just import and soap tool clearly says hey, you need two integers, please pass and you will simply pass. That's all. And soap message also will be constructed automatically from this Wsdl. Okay, so this Wsdl also tells you that how soap message should be created. Okay. That headache also soap UI tool is taken care. It will create a standard soap message for you. And if you simply pass the inputs, that's all. Okay, for knowledge purpose. I'm telling you how to deal with all this. All right. Yeah. So let's continue in our next lecture on discussing these things. Thank you.