Python [XML-RPC] 01 Research
Skills:
API Design50%
Key Takeaways
Explores Python's XML-RPC library for remote procedure calls
Full Transcript
hey what's up guys welcome back to another python video uh we're looking at a whole new module this time around we're looking at a new series for xml rpc lib and you're probably looking at me like what is that let's check it out i'm on google right now you can just kind of type in python xml rpc lib and uh our first result here is some nice python documentation and we're just gonna hop right into it so the first thing that you will see is this note this notification the xml rpc module has been renamed to xmlrpc.client in python 3. the 2 3 tool will automatically adapt imports when converting your sources to python 3. i mean whatever i'm using python 2.7 something or other not python 3. if you're using python 3 that's your business go do what you want to do you do you man i'll do me so um yeah i'm using python 2.7 so i'm not going to worry about xml rpc.client and and all that jazz and the 2-3 tool but i'm just going to look at what we've got here working xml rpc lib okay go into the documentation the first thing that it kind of presents to you is that xmlrpc is a remote procedure call method that uses xml passed by http or hypertext transfer protocol as a transport with it a client can call methods like functions in in code and in programming methods with parameters on a remote server and the server is named by uri or uniform research i think identifier anyway that's like a url address or something you type in your address bar in your browser it's a webpage it's not a web page but it's the internet you know http the internet blah blah and it gets you are returned structured data so this module supports writing xml rpc client code and it handles all the details of translating between comparable python objects and xml on the wire there's a warning that it's not secure against maliciously constructed data if you need to parse untrusted or authenticated data check out xml vulnerabilities and stuff like that um there's a note here that it's changed in version 2.79 for https uris for secure hypertext transfer protocol the library now performs all the necessary certificate and host name checks by default that's cool i think um if we just kind of move on here looking through the documentation the first thing that it tells us is about this nifty class called server proxy and this is kind of the bare bones of the library from what i understand so just going through the reading here a server proxy instance is an object that manages communication with a remote xml tac rpc server the required first argument is a uri okay uniform resource indicator not identifiers i was i was close it'll normally be the url of the server the optional second argument is a transport factor instance more information um some of the stuff i'm not going to go through because in this tutorial in this series i'm going to get through this on a little bit of a higher level i'm going to show you what the library does what you can do with it but i'm not going to show you what more you can do with it so i'll show you some stuff but not totally not everything that you can manipulate with this library if you want to learn more about it dude do your own reading doing research that's awesome i encourage that um the returned instance is a proxy object with methods like functions that can be used to invoke corresponding rpc calls on the remote server if the remote server supports the introspection api the proxy can also be used to query the remote server for methods it supports also known as service discovery and fetch other server associated metadata that's kind of cool so that means like you can figure out what the server can give you like what methods can you use what functions can you call and sort of thing so this instance the server proxy takes python basic types and argument and an argument sorry it will return python basic types and classes things that are comparable include the following so these are just data types that you can use between python and the xml rpc um it looks like it uses pretty much the normal stuff that we use in python and also dates and binary data so in case you want to use any of those you can i'm probably not going to cover them but it says here these are the full set of data types supported by the convention xmlrpc talks about raising faults and errors and stuff like that here's another line surveyer wow i talk trust me i know english i'm intelligent i promise server is retained as an alias for server proxy for backwards compatibility new code should use server proxy and server proxy up top here is the thing that we were just reading this is the class that we're using to create stuff so you can use server you can remove this word proxy but they say at least they encourage using server proxy um okay and i also want to move on to this xmlrpc how to um yeah let's let's go through that before we go into anything else so click on this and it takes me right to tldp.org it's like the linux documentation product uh project super awesome thing so this page describes how to use xml rpc to implement clients and servers in a variety of languages provides example code in perl python hey python that's what we're going to be looking at in other languages so okay that's cool so in the table of contents uh my eyes went right to what is xml rpc let's check that out now it says that xml rpc oh there's a website for it that's cool i can look through that too xmlrpc is a simple portable way to make remote procedure calls over http it can be used with perl java python c c plus plus php and many other programming languages okay implementations are available for unix windows and the macintosh the macintosh um looks like it shows some pearl code it also shows some python code and it's using our library xml rpc lib cool that's something we're just going to check out looking at the code here it imports the library creating a new variable or object returned by the server class oh and just like our documentation said server works but most people should now use server proxy it takes the url or the uri of where the rpc lives on the internet and then it looks like it's calling a function from the server and getting return some data so that's all it is really it's just running a function calling a function you're calling the server it's like a it's cool it kind of it kind of seems like a programmer server like it's just storing a bunch of functions that you might want to use later on in your life that's kind of nifty i guess um in this in the following few chapters you'll learn how to write these clients and servers in a variety of programming languages super cool um how it works fully described in dave weiner's official specification oh hey okay this is the same website that we were just at um and it's okay it's xml all behind the scenes that makes sense xml rpc is a remote procedure calling protocol that works over the internet we've covered that an xml rpc message is an http post request like you simply see on websites and that's a good thing the body of the request is an xml a procedure executes on the server and the value returned is also formatted xml that's kind of cool so examples here oh oh thanks semantech thanks for your help back to what i was talking about or what i was trying to talk about you know me this is the behind the scenes stuff of how the library and xml rpc really works i'm not going to show you all this but i want you to know that it exists so if you want to read up on it you totally can supported data types are everything we were just kind of looking at in the documentation of our library there's the history xml other protocols i'm not really worried about that common xml or pc interfaces so these servers provide built-in methods they aren't part of xml rpc itself but they make for handy add-ons introspection hey that's the same thing we're reading about like service discovery in the python documentation discovering server apis ed dumbbell proposed the following set of methods list methods method help signature okay and they always return either an array or string an array i would think if a server supports these methods you can print it out or print out some documentation uh so here's the same python code import xmlrpclib server creating the server same thing we were looking at beforehand and for each of these methods that you've got in list methods like it will return them to you it'll print what the method is and a help command for what it actually does what the function will do so these methods are supported by servers written in php c and microsoft introspection support for perl python and java is available at xml rpc hacks page i'll check that one out okay looks like this page doesn't exist that's fine we'll just go on our merry way um and let's keep checking this out to demonstrate xml rpc here's the following api in as many languages as possible some indifference okay this is just a function they're going to show off to us so let's check it out xmlrpc with perl we're going to look at python and i know i saw it in the table of contents okay sweet next page using html rpc with python next installing it here it is a python client xml rpc lib server url that's just a string that saves the server connection page they just okay they just reach for the function they call it and their return data and they can just use it in the code that's super cool all right is there anything more for us then it just goes on to show other languages java php all right i'm gonna go back to our documentation xml rpc lib because i know there was another section we were thinking about looking at server proxy objects instance has a method corresponding to each remote procedure call accepted by the xml rpc server i know you guys can read all this on your own and i mean i would recommend doing that this video is kind of for like a quick crash course through it servers that support the xml introspection api support some common method groups under the reserved system attributes list methods methods oh hey these are the same things we were looking at in the uh yeah method help these are the same things we were looking at in the linux documentation so this method returns a list of strings each one for the method or the function supported by the server that's pretty cool so you can just learn more about what it is that you're connected to and what you're looking at same thing with method help and method signature sweet all right so i think i'm good with what i wanted to present to you in this video this video in this tutorial this one was just all about research learning what this library can do and what it will do in the next video we'll actually take a look at the code and we'll just execute everything we just saw and at least we're kind of looking at and researching and that way we can get a better feel for it and we can actually do it on our own so that's it um i think i'm good uh i hope you guys are okay with this kind of learning style i know it's a little bit different from my normal series but this is the way that i wanted to at least present xml rpc lib so on to the next video thanks for watching guys and i'll see you soon
Original Description
If you would like to support me, please like, comment & subscribe, and check me out on Patreon: https://patreon.com/johnhammond010
E-mail: johnhammond010@gmail.com
PayPal: http://paypal.me/johnhammond010
GitHub: https://github.com/JohnHammond
Site: http://www.johnhammond.org
Twitter: https://twitter.com/_johnhammond
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from John Hammond · John Hammond · 23 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
▶
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Code Commentaries? PHP to JavaScript in Bash and PHP!
John Hammond
Tutorials? MySQL connection with PHP and Bash!
John Hammond
Variable Naming in Python! Happy Birthday, Linux! Nokia N900!
John Hammond
JavaScript Splits The URL!
John Hammond
HTML Tables in Python!
John Hammond
HTML, Net Shares, GML!
John Hammond
Python 08 Programming Style and Comments
John Hammond
Python 26 Object Oriented Programming
John Hammond
75 Python Tutorials, Out Now!
John Hammond
Batch 14 Mathematical Expressions
John Hammond
Batch 85 Array Append
John Hammond
Batch 86 Array Count
John Hammond
Batch 87 Array Index
John Hammond
Batch 88 Array Insert
John Hammond
Batch 89 Array Remove
John Hammond
Batch 90 Array Reverse
John Hammond
Python [colorama] 00 Installing on Linux
John Hammond
Python [colorama] 09 Cursor Position
John Hammond
Python [hashlib] 02 Algorithms
John Hammond
Python 00 Installing IDLE on Linux
John Hammond
Python [pygame] 11 Rectangular Collision Detection
John Hammond
Python [pygame] 12 Platforming Rectangular Collision Resolution
John Hammond
Python [XML-RPC] 01 Research
John Hammond
Python [pyenchant] 03 Personal Word Lists
John Hammond
FancyURLopener Authentication and User-Agent [urllib] 03
John Hammond
Python 04: PEP8 Coding
John Hammond
Python Challenge! 17 COOKIES
John Hammond
Google CTF 2016: Ernst Echidna
John Hammond
Google CTF 2016: Spotted Quoll
John Hammond
Google CTF 2016: Can you Repo It?
John Hammond
Google CTF 2016: No Big Deal
John Hammond
Google CTF 2016: In Recorded Conversation
John Hammond
Homemade CTF Challenge: 01 "Orchestra"
John Hammond
Homemade CTF Challenge: 02 "Bae's Base"
John Hammond
Homemade CTF Challenge: 03 "Web Hunt"
John Hammond
Homemade CTF Challenge: 04 "UPX"
John Hammond
Homemade CTF Challenge: 05 "The Assumption Song"
John Hammond
Homemade CTF Challenge: 06 "A Brisk Stroll"
John Hammond
Homemade CTF Challenge: 06 "I lost my password!"
John Hammond
web25 :: Mr. Robot : EKOPARTY CTF 2016
John Hammond
web50 : RFC 7230 :: EKOPARTY CTF 2016
John Hammond
misc50 : Hidden inside EKO :: EKOPARTY CTF 2016
John Hammond
Hack The Vote 2016 CTF: Sander's Fan Club [web100]
John Hammond
Hack The Vote 2016 CTF Warpspeed [forensics150]
John Hammond
Juniors CTF 2016 :: Black Suprematic Square
John Hammond
Juniors CTF 2016 :: Six Strange Tales
John Hammond
Juniors CTF 2016 :: Lost Code
John Hammond
Juniors CTF 2016 :: Here Goes!
John Hammond
Juniors CTF 2016 :: Southern Cross
John Hammond
Juniors CTF 2016 :: Clone Attack
John Hammond
Juniors CTF 2016 :: Dirty Repo
John Hammond
Juniors CTF 2016 :: Hackers Blog
John Hammond
Juniors CTF 2016 :: Voting!!!
John Hammond
Juniors CTF 2016 :: The Good, The Bad and The Junkman
John Hammond
Juniors CTF 2016 :: Stop Thief!
John Hammond
Juniors CTF 2016 :: ROFL
John Hammond
Juniors CTF 2016 :: Restriced Area
John Hammond
Juniors CTF 2016 :: Oh SSH!
John Hammond
HackCon CTF 2017 TRIVIA and BONUS Challenges
John Hammond
HackCon CTF 2017 "Bacche" Challenges
John Hammond
More on: API Design
View skill →Related Reads
📰
📰
📰
📰
A lightweight workflow for keeping up with AI conference papers
Dev.to · Daniel
Why CitedEvidence Believes Great Researchers Read Less Than You Think
Medium · AI
How to Write a Literature Review That Actually Argues Something
Medium · Machine Learning
I Built a Personal Paper Engine to Stop Losing Research Papers
Dev.to · Ethan
🎓
Tutor Explanation
DeepCamp AI