title
Web Services Tutorial 3 SOAP & REST Tutorial
description
Get the Code Here : http://goo.gl/YGeQ86
Web Services 1 : https://www.youtube.com/watch?v=iqNiINZ4Sxg
Web Services 2 : https://www.youtube.com/watch?v=S1ZId7jBThQ
PHP : https://www.youtube.com/watch?v=7TF00hJI78Y
MySQL : https://www.youtube.com/watch?v=yPu6qV5byu4
PHP / MySQL : https://www.youtube.com/watch?v=mpQts3ezPVg
In this part of my web services tutorial, I provide both a non-WSDL SOAP server and a REST Web Service Example program. The goal is to keep everything simple and easy to understand because many people are confused by both.
I decided to avoid covering WSDL (Web Service Description Language) because it is very common for these to be generated by software. I also decided to focus on just the GET method with REST because it is most commonly used.
detail
{'title': 'Web Services Tutorial 3 SOAP & REST Tutorial', 'heatmap': [{'end': 346.894, 'start': 317.696, 'weight': 0.746}], 'summary': 'Tutorial provides a comprehensive overview of soap and rest in web services, emphasizing simplicity and understanding. it covers creating a rest api with methods such as get, post, put, and delete, and demonstrates php code to print out student information and generate a student list with links.', 'chapters': [{'end': 337.206, 'segs': [{'end': 29.264, 'src': 'embed', 'start': 0.109, 'weight': 3, 'content': [{'end': 3.374, 'text': 'Well, hello, Internet, and welcome to part three of my web services tutorial.', 'start': 0.109, 'duration': 3.265}, {'end': 8.803, 'text': "Today I'm going to cover a very simple example of how SOAP as well as REST works.", 'start': 3.434, 'duration': 5.369}, {'end': 11.206, 'text': "And I have a lot to do, so let's get into it.", 'start': 9.183, 'duration': 2.023}, {'end': 18.298, 'text': "okay. so here is our students class and if you haven't watched the previous tutorials, you should definitely watch those,", 'start': 12.315, 'duration': 5.983}, {'end': 23.221, 'text': 'otherwise this might be really confusing and there is a link to them underneath of this video in the description.', 'start': 18.298, 'duration': 4.923}, {'end': 29.264, 'text': "so i have my students class and i'm going to be using that once again inside of this guy.", 'start': 23.221, 'duration': 6.043}], 'summary': 'Tutorial covers soap and rest, using students class.', 'duration': 29.155, 'max_score': 0.109, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM109.jpg'}, {'end': 72.673, 'src': 'embed', 'start': 40.83, 'weight': 0, 'content': [{'end': 41.51, 'text': 'very simple.', 'start': 40.83, 'duration': 0.68}, {'end': 43.911, 'text': "so we're not going to get into very complicated things.", 'start': 41.51, 'duration': 2.401}, {'end': 47.313, 'text': "but by the end of this I think you'll understand both SOAP and REST.", 'start': 43.911, 'duration': 3.402}, {'end': 60.802, 'text': "then what I'm going to do is I'm going to create a string here and it's going to be called student names and I'm going to put Dale Cooper inside of here and all the other students that we have seen in the previous tutorials.", 'start': 47.313, 'duration': 13.489}, {'end': 66.227, 'text': "and then what i'm going to do here to keep this very simple is whenever this method is going to be called,", 'start': 60.802, 'duration': 5.425}, {'end': 72.673, 'text': "i am just going to return student names and we're going to be using that in the other files we're going to make,", 'start': 66.227, 'duration': 6.446}], 'summary': 'Introduction to soap and rest, creating a string of student names for use in other files.', 'duration': 31.843, 'max_score': 40.83, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM40830.jpg'}, {'end': 147.704, 'src': 'embed', 'start': 100.762, 'weight': 1, 'content': [{'end': 106.264, 'text': "Either way, what it is, is it's based on XML, and it's a way for us to access web services.", 'start': 100.762, 'duration': 5.502}, {'end': 113.847, 'text': 'Now a WSDL or Web Service Description Language is an XML format commonly used with SOAP.', 'start': 106.684, 'duration': 7.163}, {'end': 118.188, 'text': "And what it's used for is describing the functionality of network services.", 'start': 114.147, 'duration': 4.041}, {'end': 125.991, 'text': 'As well, a WSDL file is going to describe how the service is called, what parameters it expects, and the data structures it returns.', 'start': 118.588, 'duration': 7.403}, {'end': 131.513, 'text': "What I'm going to do here to keep everything very simple is use a non-WSDL SOAP server.", 'start': 126.291, 'duration': 5.222}, {'end': 140.399, 'text': 'And these are very, very common because very often what people do is they have the WSDL file actually constructed using software.', 'start': 131.813, 'duration': 8.586}, {'end': 142.36, 'text': "So it's very complicated.", 'start': 140.519, 'duration': 1.841}, {'end': 145.602, 'text': 'If I was going to cover WSDL, I would cover it in its own tutorial.', 'start': 142.5, 'duration': 3.102}, {'end': 147.704, 'text': "So for now, what I'm going to do.", 'start': 145.843, 'duration': 1.861}], 'summary': 'Xml-based wsdl used to describe web services, including parameters and data structures.', 'duration': 46.942, 'max_score': 100.762, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM100762.jpg'}], 'start': 0.109, 'title': 'Soap and rest in web services', 'summary': 'Covers a simple example of soap and rest, demonstrating the creation of a method to retrieve student names, emphasizing simplicity and understanding of both technologies. it also covers the basics of soap, including its xml-based structure, and the creation of a non-wsdl soap server and client in php, focusing on teaching 90% of the necessary knowledge.', 'chapters': [{'end': 80.276, 'start': 0.109, 'title': 'Web services tutorial part 3', 'summary': 'Covers a simple example of soap and rest, demonstrating the creation of a method to retrieve student names, emphasizing simplicity and understanding of both technologies.', 'duration': 80.167, 'highlights': ['The tutorial covers a simple example of SOAP and REST The tutorial demonstrates the creation of a method to retrieve student names using SOAP and REST.', 'Emphasis on simplicity The tutorial stresses keeping the examples simple to aid in understanding SOAP and REST.', "Creation of a method to retrieve student names A new method 'get student names' is created to retrieve student names, with 'Dale Cooper' as an example."]}, {'end': 337.206, 'start': 80.336, 'title': 'Soap service and soap client', 'summary': 'Covers the basics of soap (simple object access protocol), including its xml-based structure and the creation of a non-wsdl soap server and client in php, emphasizing the simplicity of the process and the focus on teaching 90% of the necessary knowledge.', 'duration': 256.87, 'highlights': ['SOAP is based on XML and used to access web services, with a WSDL file commonly describing the functionality of network services, including the service call, expected parameters, and returned data structures. SOAP, based on XML, enables access to web services. WSDL file describes network service functionality, including service call, parameters, and data structures.', 'The tutorial focuses on creating a non-WSDL SOAP server and client, simplifying the process to teach 90% of the necessary knowledge, with the goal of allowing learners to explore the remaining aspects on their own. Emphasis on creating a non-WSDL SOAP server and client, aiming to teach 90% of the necessary knowledge and encouraging learners to explore the remaining aspects.', "Creation of a SOAP server involves defining the service URI, creating a SOAP server object, and specifying the class that holds the available functions, followed by handling SOAP requests. Creation of SOAP server involves defining service URI, creating SOAP server object, specifying available functions' class, and handling SOAP requests.", 'Creation of a SOAP client involves defining the service location, creating a SOAP client object, making a call to a specific procedure, and handling exceptions such as soap fault. Creation of SOAP client involves defining service location, creating SOAP client object, making procedure calls, and handling soap fault exceptions.']}], 'duration': 337.097, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM109.jpg', 'highlights': ["Creation of a method to retrieve student names A new method 'get student names' is created to retrieve student names, with 'Dale Cooper' as an example.", 'Emphasis on creating a non-WSDL SOAP server and client, aiming to teach 90% of the necessary knowledge and encouraging learners to explore the remaining aspects.', 'SOAP is based on XML and used to access web services, with a WSDL file commonly describing the functionality of network services, including the service call, expected parameters, and returned data structures.', 'The tutorial covers a simple example of SOAP and REST The tutorial demonstrates the creation of a method to retrieve student names using SOAP and REST.']}, {'end': 676.427, 'segs': [{'end': 382.918, 'src': 'embed', 'start': 356.403, 'weight': 1, 'content': [{'end': 360.485, 'text': 'Now, there are four main types of methods you can use.', 'start': 356.403, 'duration': 4.082}, {'end': 364.548, 'text': "I'm only going to cover git, which is used to retrieve data from a resource.", 'start': 360.806, 'duration': 3.742}, {'end': 369.47, 'text': "There's also post, which is used to create a new resource, which is considered somewhat unsafe.", 'start': 364.828, 'duration': 4.642}, {'end': 376.074, 'text': 'Then we have put, which is used to update a resource, which is also kind of considered to be unsafe.', 'start': 369.791, 'duration': 6.283}, {'end': 382.918, 'text': "And then there is delete, which is used to delete a resource, which I'm sure you can understand why that would be a little bit unsafe.", 'start': 376.434, 'duration': 6.484}], 'summary': 'Four main http methods: git, post, put, and delete for data retrieval, creation, update, and deletion.', 'duration': 26.515, 'max_score': 356.403, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM356403.jpg'}, {'end': 430.548, 'src': 'embed', 'start': 393.967, 'weight': 0, 'content': [{'end': 399.872, 'text': 'this is going to be a little bit more elaborate than the last one, and this is the api.php file.', 'start': 393.967, 'duration': 5.905}, {'end': 405.437, 'text': "now, inside of this, i'm going to create student info, which is going to be an array,", 'start': 399.872, 'duration': 5.565}, {'end': 410.122, 'text': "And then what we're going to do is allow them to pull in different types of information.", 'start': 405.697, 'duration': 4.425}, {'end': 417.37, 'text': "Now, you would normally do this inside of a database, but to keep this simple, I'm just going to put everything inside of a switch statement.", 'start': 410.162, 'duration': 7.208}, {'end': 420.354, 'text': 'So case, they pass in 1.', 'start': 417.651, 'duration': 2.703}, {'end': 423.918, 'text': 'We are going to set the student info for our array.', 'start': 420.354, 'duration': 3.564}, {'end': 430.548, 'text': "be first name, lowercase, first name to match our database that i've been using here in all these examples,", 'start': 424.258, 'duration': 6.29}], 'summary': 'Elaborate api.php file creates student info array and allows pulling different types of information.', 'duration': 36.581, 'max_score': 393.967, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM393967.jpg'}, {'end': 614.563, 'src': 'embed', 'start': 564.423, 'weight': 4, 'content': [{'end': 569.905, 'text': "So get student list is going to be one of the options that they're going to have to use our service.", 'start': 564.423, 'duration': 5.482}, {'end': 578.127, 'text': "And then we'll set our value to whatever it would be to cover or to execute this method right here and then break.", 'start': 570.305, 'duration': 7.822}, {'end': 583.808, 'text': 'And the other option for them is going to be get student right here.', 'start': 578.727, 'duration': 5.081}, {'end': 590.568, 'text': "In that situation, we're going to store what is returned whenever get student info is called.", 'start': 584.484, 'duration': 6.084}, {'end': 599.253, 'text': "And then along the way, we're also going to pass inside of it the ID, specific ID for the specific student information we want.", 'start': 590.768, 'duration': 8.485}, {'end': 600.113, 'text': 'And there that is.', 'start': 599.473, 'duration': 0.64}, {'end': 608.879, 'text': 'And then, after we do all of this way down here at the bottom, if we want to return JSON data, for example, we can say exit and then encode.', 'start': 600.453, 'duration': 8.426}, {'end': 613.302, 'text': 'this information is JSON, stick with me here and make sense in a second.', 'start': 608.879, 'duration': 4.423}, {'end': 614.563, 'text': "so that's the API.", 'start': 613.302, 'duration': 1.261}], 'summary': 'The api offers options to get student list and information using specific ids, and return json data.', 'duration': 50.14, 'max_score': 564.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM564423.jpg'}, {'end': 661.258, 'src': 'embed', 'start': 635.519, 'weight': 6, 'content': [{'end': 641.364, 'text': 'ws and then call the API, which is the file we just created, and then to action.', 'start': 635.519, 'duration': 5.845}, {'end': 644.146, 'text': "see, we're doing everything through just a basic URL.", 'start': 641.364, 'duration': 2.782}, {'end': 653.473, 'text': "we're going to pass in git student and id is equal to, and then after that we can tack on the id that was specific to what they clicked on,", 'start': 644.146, 'duration': 9.327}, {'end': 654.934, 'text': 'go down to the end, put a semicolon.', 'start': 653.473, 'duration': 1.461}, {'end': 657.516, 'text': 'So see right here, get student right there.', 'start': 655.214, 'duration': 2.302}, {'end': 661.258, 'text': "If we jump over into the API, get student, that's this guy right here.", 'start': 657.536, 'duration': 3.722}], 'summary': 'Creating a basic url to call the api for getting specific student data.', 'duration': 25.739, 'max_score': 635.519, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM635519.jpg'}], 'start': 337.286, 'title': 'Creating rest api and calling it, php rest service tutorial, api service for student information', 'summary': 'Covers creating a rest api with methods such as get, post, put, and delete, retrieving student information with an array containing five students, creating a php rest service, and implementing an api service to fetch student information based on user choice and specific ids.', 'chapters': [{'end': 455.797, 'start': 337.286, 'title': 'Creating rest api and calling it', 'summary': 'Discusses creating a rest api and calling it, covering the main types of methods such as git, post, put, and delete, and creating a function to retrieve student information with an array containing five different students.', 'duration': 118.511, 'highlights': ["Creating a function to retrieve student info with an array containing five different students The chapter covers creating a function called 'get student info' to retrieve student information with an array containing five different students.", 'Explaining the main types of REST methods: git, post, put, and delete The chapter explains the main types of methods in REST including git for retrieving data, post for creating new resources, put for updating resources, and delete for deleting resources.', 'Demonstrating the switch statement to handle different types of information The chapter demonstrates using a switch statement to handle different types of student information, showcasing the use of case to set student info in an array based on the input parameter.']}, {'end': 544.977, 'start': 455.997, 'title': 'Php rest service tutorial', 'summary': 'Demonstrates creating a php rest service to return information based on user choice, allowing access to student list and executing methods based on requests.', 'duration': 88.98, 'highlights': ['Creating a PHP REST service to return information based on user choice', 'Allowing access to student list and displaying it on the screen', 'Executing methods based on requests']}, {'end': 676.427, 'start': 544.977, 'title': 'Api service for student information', 'summary': "Explains the implementation of an api service for getting student information by providing options to execute 'get student list' or 'get student info' and utilizing specific ids to fetch and print the proper student information.", 'duration': 131.45, 'highlights': ["The API service provides two main options: 'get student list' and 'get student info', which can be executed by setting the value and breaking after execution. The API offers two main options for accessing student information, allowing for the execution of 'get student list' and 'get student info'.", "The process involves passing the specific ID for the student information while calling 'get student info' and then returning the JSON data after executing the API. The process includes passing the specific ID for student information retrieval and returning the JSON data after executing the API.", "The implementation involves using basic URL and passing the 'git student' option with the specific ID to fetch the student information, making it very useful and easy to access. The implementation utilizes basic URL and the 'git student' option with a specific ID to fetch student information, making it both useful and accessible."]}], 'duration': 339.141, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM337286.jpg', 'highlights': ["The chapter covers creating a function called 'get student info' to retrieve student information with an array containing five different students.", 'The chapter explains the main types of methods in REST including git for retrieving data, post for creating new resources, put for updating resources, and delete for deleting resources.', 'The chapter demonstrates using a switch statement to handle different types of student information, showcasing the use of case to set student info in an array based on the input parameter.', 'Creating a PHP REST service to return information based on user choice.', "The API offers two main options for accessing student information, allowing for the execution of 'get student list' and 'get student info'.", 'The process includes passing the specific ID for student information retrieval and returning the JSON data after executing the API.', "The implementation utilizes basic URL and the 'git student' option with a specific ID to fetch student information, making it both useful and accessible."]}, {'end': 934.791, 'segs': [{'end': 725.475, 'src': 'embed', 'start': 707.645, 'weight': 0, 'content': [{'end': 721.354, 'text': "so we'll do a last name and change this to last name and then address as well and address reopen so that we can create some more php code and then we're going to say else we're going to print out a list of the students onto the screen in that situation,", 'start': 707.645, 'duration': 13.709}, {'end': 725.475, 'text': "because that list is what they're going to click on to be able to get the student information.", 'start': 721.613, 'duration': 3.862}], 'summary': 'Developing php code to display a list of students with their last names and addresses.', 'duration': 17.83, 'max_score': 707.645, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM707645.jpg'}, {'end': 780.551, 'src': 'embed', 'start': 752.231, 'weight': 1, 'content': [{'end': 758.26, 'text': "where we want to call is get student list, and that's going to provide that and then store it, so we'll be able to use that list.", 'start': 752.231, 'duration': 6.029}, {'end': 759.722, 'text': 'hey, get student list.', 'start': 758.26, 'duration': 1.462}, {'end': 761.703, 'text': 'see, Get student list is right here.', 'start': 759.722, 'duration': 1.981}, {'end': 764.364, 'text': 'Whenever this is called, this method is going to execute.', 'start': 761.983, 'duration': 2.381}, {'end': 768.186, 'text': "And in this situation, we're going to decode the JSON data.", 'start': 764.544, 'duration': 3.642}, {'end': 772.528, 'text': 'JSON, decode, pass in the student list, and true.', 'start': 768.346, 'duration': 4.182}, {'end': 780.551, 'text': "Once again, close off the PHP, reopen, and I'm going to go for each student list as student.", 'start': 772.828, 'duration': 7.723}], 'summary': 'The php code decodes json data to get and store a student list.', 'duration': 28.32, 'max_score': 752.231, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM752231.jpg'}, {'end': 843.746, 'src': 'embed', 'start': 812.569, 'weight': 2, 'content': [{'end': 814.712, 'text': 'Open PHP up again and echo.', 'start': 812.569, 'duration': 2.143}, {'end': 818.238, 'text': "And then specifically we're going to put student underscore.", 'start': 815.033, 'duration': 3.205}, {'end': 823.606, 'text': 'Follow that up with student underscore and whatever the ID is for it.', 'start': 818.478, 'duration': 5.128}, {'end': 827.003, 'text': "Close to PHP so that we'll be able to put in the closing tag.", 'start': 824.002, 'duration': 3.001}, {'end': 828.243, 'text': 'Open it back up again.', 'start': 827.263, 'duration': 0.98}, {'end': 829.243, 'text': 'And echo.', 'start': 828.263, 'duration': 0.98}, {'end': 830.223, 'text': 'And student.', 'start': 829.603, 'duration': 0.62}, {'end': 832.164, 'text': "And then we'll also pass in the name.", 'start': 830.543, 'duration': 1.621}, {'end': 836.465, 'text': 'Close to PHP code so that we can put in the closing tag for our link.', 'start': 832.404, 'duration': 4.061}, {'end': 838.725, 'text': "And then we'll also throw a break statement in there.", 'start': 836.805, 'duration': 1.92}, {'end': 843.746, 'text': "And then in this situation, for this foreach to match up with it, we're going to have to go PHP.", 'start': 838.745, 'duration': 5.001}], 'summary': 'Using php to echo student id and name in a loop.', 'duration': 31.177, 'max_score': 812.569, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM812569.jpg'}], 'start': 676.767, 'title': 'Php student information and list display', 'summary': 'Covers writing php code to print out student information, creating a student list by calling an api, and generating a student list with links to display additional information, offering insights into code implementation and functionality.', 'chapters': [{'end': 772.528, 'start': 676.767, 'title': 'Php student information and api call', 'summary': 'Covers writing php code to print out student information and create a student list by calling an api to get the list.', 'duration': 95.761, 'highlights': ['Creating PHP code to print out student information including first name, last name, and address.', 'Calling an API to get the student list using file_get_contents and decoding the JSON data.']}, {'end': 934.791, 'start': 772.828, 'title': 'Php student list and information display', 'summary': 'Demonstrates the process of creating a php script to generate a student list with links to display additional information, providing insights into the implementation and functionality of the code.', 'duration': 161.963, 'highlights': ['The code iterates through a student list to create links for each student, utilizing PHP echo statements for dynamic URL generation and student ID retrieval.', 'The demonstration showcases the seamless display of additional student information upon clicking the generated links, emphasizing the functionality and practical application of the PHP script.', 'The speaker invites engagement from the audience for further exploration of REST and related topics, encouraging questions and comments for future content.']}], 'duration': 258.024, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/KzFqke8g0aM/pics/KzFqke8g0aM676767.jpg', 'highlights': ['Creating PHP code to print out student information including first name, last name, and address.', 'Calling an API to get the student list using file_get_contents and decoding the JSON data.', 'The code iterates through a student list to create links for each student, utilizing PHP echo statements for dynamic URL generation and student ID retrieval.', 'The demonstration showcases the seamless display of additional student information upon clicking the generated links, emphasizing the functionality and practical application of the PHP script.']}], 'highlights': ['The tutorial covers a simple example of SOAP and REST The tutorial demonstrates the creation of a method to retrieve student names using SOAP and REST.', "The chapter covers creating a function called 'get student info' to retrieve student information with an array containing five different students.", 'The chapter explains the main types of methods in REST including git for retrieving data, post for creating new resources, put for updating resources, and delete for deleting resources.', 'The chapter demonstrates using a switch statement to handle different types of student information, showcasing the use of case to set student info in an array based on the input parameter.', 'Creating a PHP REST service to return information based on user choice.', "The API offers two main options for accessing student information, allowing for the execution of 'get student list' and 'get student info'.", 'The process includes passing the specific ID for student information retrieval and returning the JSON data after executing the API.', "The implementation utilizes basic URL and the 'git student' option with a specific ID to fetch student information, making it both useful and accessible.", 'Creating PHP code to print out student information including first name, last name, and address.', 'Calling an API to get the student list using file_get_contents and decoding the JSON data.', 'The code iterates through a student list to create links for each student, utilizing PHP echo statements for dynamic URL generation and student ID retrieval.', 'The demonstration showcases the seamless display of additional student information upon clicking the generated links, emphasizing the functionality and practical application of the PHP script.', 'Emphasis on creating a non-WSDL SOAP server and client, aiming to teach 90% of the necessary knowledge and encouraging learners to explore the remaining aspects.', 'SOAP is based on XML and used to access web services, with a WSDL file commonly describing the functionality of network services, including the service call, expected parameters, and returned data structures.', "Creation of a method to retrieve student names A new method 'get student names' is created to retrieve student names, with 'Dale Cooper' as an example."]}