Download presentation
Presentation is loading. Please wait.
Published byShannon Gardner Modified over 9 years ago
1
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN 6710 - Section A – TR 9:30-10:45 CRN 10570 – Section B – TR 5:30-6:45
2
SOAP Simple Object Access Protocol (SOAP) This protocol is most often used to interact with purchased software w3schools has an open SOAP tool that we are going to use, but because many of the ones out there are part of purchased software, they require authentication Examples: Cascade – Main website CMS Sharepoint – MyUNG website
3
SOAP To work with SOAP, we are going to use a server side library inside of PHP To get started, we need to take a look at the WSDL (Web Service Description Language) http://www.w3schools.com/xml/tempconvert.asmx?WS DL This is an XML formatted file which describes the SOAP object and the functions/variables available operation (portType) -> message -> element (types)
4
SOAP To use the library, we need to send and receive XML formatted data To simplify this process, we are going to use the PHP SoapClient library We will create an object of the SoapClient using the WSDL file, so the object knows where to send the data Then we can access the functions in the WSDL off of the SoapClient variable we created
5
cURL cURL is a command line tool for transferring data with URL syntax We can think of this as somewhat like a server side version of what AJAX does Our server is basically opening a web page, and we can pass the page some variables, and whatever the page responds with, we can then use on our page
6
cURL PHP Functions: curl_init() curl_setopt() CURLOPT_URL (string) CURLOPT_POST (boolean) CURLOPT_POSTFIELDS (associative array) CURLOPT_RETURNTRANSFER (boolean) CURLOPT_CUSTOMREQUEST (string) curl_exec() curl_close()
7
REST APIs Representational State Transfer (REST) REST API’s generally use the Custom Request we looked at in cURL to specify what kind of command is being run GET, POST, PUT, DELETE, etc To work with a REST API, you would use a tool like cURL or AJAX
8
APIs Many APIs are based around the XML standard Extensible Markup Language (XML) PHP has a few libraries to simplify working with XML data, basically converting into an object you can work your way through in a structured manner One of the libraries I have found useful for working with XML in PHP is SimpleXMLElement It allows for creating an object from a string or a URL
9
Lab 7 - API Due Nov 12 th Create a web page that uses the Google Chart API to graph some data from a database table Include on the page a form to insert new data into the database (I should be able to see the chart update as I insert new data)
10
Next Time Next time we will look at Server Configurations Reminders: Lab 6 (C#) is due today Project 2 is due today Lab 7 (API) is due on Nov 12 th Term Project is due on Dec 10 th
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.