SlideShare a Scribd company logo
Mandakini Kumari
    June 15th 2012
Who am I
 Have 9 + years of experience in open source specially
  PHP, Drupal & Web Services.
 Active crusader to improve effectiveness and reach of
  Free & Open Source Software(FOSS).
 Impart industrial consultancy for best use of software
  application.
 Frequently conduct training for students and
  industrial experts.
What am I going to talk about ?
 Use of Web Services ?
 What is Web Services
 Different Ways: SOAP & REST
 SOAP Vs REST
 How am I going to use REST
 Example: Twitter, Paypal
Use of Web Services(WS)
 Payment Gateway integration for E-commerce site.
 Google Map for a Real Estate Site.
 Product detail for a price comparison website
 Weather forecast for a news or blog site
 Mashup: Combine data from one or more source and
 integrate application
Payment Gateway integration




        http://paypal.com
Why WS for Payment getaway
 Very Fast
 Very Reliable
 Secure
 User don’t know what getway used by the site
 User don’t need to register on payment site e.g. paypal
 Website Administration is very easy e.g. IRCT with
 netbanking ICICI
Google Map Web services for your website
Top APIs for Mashups




        http://programmableweb.com/apis
What is Web Services(WS)
 WS serves as an interface to software
  developers.
 Using WS as an API you can convert
  applications into web-applications.
 WS is the vision of ‘Future Internet’
 The basic Web services platform is XML +
  HTTP.
 WS is future for Mobile application
Web services soap and rest by mandakini for TechGig
What is SOAP
 SOAP is a simple XML-based protocol to let
  applications exchange information over HTTP
 Businesses can register their WS on UDDI(Universal
  Description, Discovery and Integration) and provide
  documentation with WSDL (Web Services Description
  Language).
 SOAP is mostly used for Enterprise applications to
  integrate wide types and another trend is to integrate
  with legacy systems
SOAP Architecture
SOAP Building Blocks
Paypal SOAP Building Blocks
A SOAP Envelope
 <?xml version="1.0"?>
  <soap:Envelope
  xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  soap:encodingStyle="http://www.w3.org/2001/12/soap-
  encoding">
  ....

  </soap:Envelope>
SOAP Header Element
 <SOAP-ENV:Header>
 <RequesterCredentials xmlns=”urn:ebay:api:PayPalAPI”
 xsi:type=”ebl:CustomSecurityHeaderType”>
 <Credentials xmlns=”urn:ebay:apis:eBLBaseComponents”
 xsi:type=”ebl:UserIdPasswordType”>
 <Username>api_username</Username>
 <Password>api_password</Password>
 <Signature>api_signature</Signature>
 <Subject>authorizing_account_emailaddress</Subject>
 </Credentials>
 </RequesterCredentials>
 </SOAP-ENV:Header>
SOAP Body Request Element
 <soap:Body>
  <m:GetPrice mlns:m="http://www.example.com/prices">
   <m:Item>Laptop</m:Item>
  </m:GetPrice>
 </soap:Body>
A SOAP Response
 HTTP/1.1 200 OK
  Content-Type: application/soap+xml; charset=utf-8
  Content-Length: nnn
  <?xml version="1.0"?>
  <soap:Envelope
  xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  <soap:Body>
   <m:GetPriceResponse xmlns:m="http://www.example.com/prices">
    <m:Price>$900</m:Price>
   </m:GetPriceResponse>
  </soap:Body>
  </soap:Envelope>
PHP SOAP Server Example
$server = new SoapServer("Library.wsdl",array("classmap"=>$classmap));
$server->addFunction("searchAuthors");
$server->addFunction("searchBooks");
$server->handle();
PHP SOAP Client Example
$client=new SoapClient("http://localhost/Library.wsdl",array("trace" => 1));
try
{
 //$response = $client->searchAuthors("Beh");
 $response = $client->searchBooks("te");
var_dump($response);
echo htmlspecialchars($client->__getLastRequest())."";
echo htmlspecialchars($client->__getLastResponse())."";
}catch(Exception $e){
 var_dump($e);
 echo $client->__getLastRequest();
echo $client->__getLastResponse();
}
RESTful Web services
 Representational State Transfer (REST) has gained
  widespread acceptance across the Web
 REST permits many different data formats
 HTTP consists in URIs, methods, status codes …
 REST is great for clean, simple, robust services
 REST is a software architecture style used in
  developing stateless web services
 REST is an acronym standing for Representational
  State Transfer.
Architecture of REST
RESTful Web Service HTTP methods
    HTTP     CRUD       SQL

    POST      Create   INSERT

     GET      Read     SELECT

     PUT      Update   UPDATE

    DELETE    Delete   DELETE
Data Format Supported By REST
 xml – almost any programming language can read
  XML
 json – useful for JavaScript and increasingly PHP apps.
 csv – open with spreadsheet programs
 html – a simple HTML table
 php – Representation of PHP code that can be
  eval()’ed
 serialize – Serialized data that can be unserialized in
  PHP
Different Methods to Interact with REST
    file_get_contents()
    cURL
    SimpleXml
1) File_get_contents()
<?php
$result = file_get_contents('http:// twitter
   .com/users/show/screenname');
var_dump($result);

HTTP Basic authentication you can use the following syntax to get data
  from your password protected RESTful AP
$user = json_decode(
  file_get_contents('http://admin:1234@example.com/index.php/api/use
  r/id/1/format/json')
);
echo $user->name;
REST from PHP: GET(CURL)
<?php
$ch = curl_init('http://twitter.com/users');
curl_exec($ch);
REST from PHP: DELETE
<?php
$ch = curl_init('http://example.com/users/ginny');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,
  'DELETE');
curl_exec($ch);
Soap Vs Rest
Why REST /1
 Creating clients, developing APIs, and understanding
  documentation is much easier in REST than SOAP
 REST permits many different data formats where as
  SOAP only permits XML
 JSON is a better fit for data and parses very faster
 REST allows better support for browser clients due to
  it’s support for JSON
 REST reads can be cached, SOAP based reads cannot
  be cached.
 REST has better performance and scalability.
Why SOAP /2
 WS-Security: SOAP supports SSL (just like REST) it also
  supports WS-Security which adds some enterprise security
  features.
 WS-AtomicTransaction: Need ACID Transactions over a service
  then you need SOAP. While REST supports transactions, it isn’t
  as comprehensive and isn’t ACID compliant
 WS-ReliableMessaging: Rest doesn’t have a standard
  messaging system and expects clients to deal with
  communication failures by retrying. SOAP has successful/retry
  logic built in and provides end-to-end reliability even through
  SOAP intermediaries.
SOAP Vs REST /3
 In Summary, SOAP is clearly useful, and important.
 For instance, if I was writing an iPhone application to
 interface with my bank I would definitely need to use
 SOAP. All three features above are required for
 banking transactions. For example, if I was
 transferring money from one account to the other, I
 would need to be certain that it completed. Retrying it
 could be catastrophic if it succeed the first time, but
 the response failed.
Questions ???
Thankyou


Mandakini Kumari
https://www.facebook.com/mandakini.kumari
http://www.slideshare.net/mandakinikumari
http://www.linkedin.com/pub/mandakini-kumari/18/93/935
Ad

More Related Content

What's hot (20)

SOAP vs REST
SOAP vs RESTSOAP vs REST
SOAP vs REST
Nadia Boumaza
 
Soap web service
Soap web serviceSoap web service
Soap web service
NITT, KAMK
 
SOAP-based Web Services
SOAP-based Web ServicesSOAP-based Web Services
SOAP-based Web Services
Katrien Verbert
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
Raveendra Bhat
 
Web service
Web serviceWeb service
Web service
Vaithiyanathan Govindarajan
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
Java web services
Java web servicesJava web services
Java web services
kumar gaurav
 
REST vs SOAP
REST vs SOAPREST vs SOAP
REST vs SOAP
Juan Luis Pérez
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
Sreeni I
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
Masud Rahman
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
OECLIB Odisha Electronics Control Library
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)
Mehul Boricha
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
Madhaiyan Muthu
 
Rest vs Soap
Rest vs SoapRest vs Soap
Rest vs Soap
Alex Pérez Barón
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
Todd Benson (I.T. SPECIALIST and I.T. SECURITY)
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
Inviqa
 
REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
Hoan Vu Tran
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
Luqman Shareef
 

Viewers also liked (16)

Restful Web Service
Restful Web ServiceRestful Web Service
Restful Web Service
Bin Cai
 
OAuth: Trust Issues
OAuth: Trust IssuesOAuth: Trust Issues
OAuth: Trust Issues
Lorna Mitchell
 
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingModularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Widhian Bramantya
 
Web of Science: REST or SOAP?
Web of Science: REST or SOAP?Web of Science: REST or SOAP?
Web of Science: REST or SOAP?
Duncan Hull
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
TestObject - Mobile Testing
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
Angelin R
 
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Kai Wähner
 
REST to RESTful Web Service
REST to RESTful Web ServiceREST to RESTful Web Service
REST to RESTful Web Service
家弘 周
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
Lorna Mitchell
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
Apigee | Google Cloud
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
Bruno Pedro
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
Robert MacLean
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
shilpi nagpal
 
Restful Web Service
Restful Web ServiceRestful Web Service
Restful Web Service
Bin Cai
 
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented ProgrammingModularizing RESTful Web Service Management with Aspect Oriented Programming
Modularizing RESTful Web Service Management with Aspect Oriented Programming
Widhian Bramantya
 
Web of Science: REST or SOAP?
Web of Science: REST or SOAP?Web of Science: REST or SOAP?
Web of Science: REST or SOAP?
Duncan Hull
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
Angelin R
 
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Microservices - Death of the Enterprise Service Bus (ESB)? (Update 2016)
Kai Wähner
 
REST to RESTful Web Service
REST to RESTful Web ServiceREST to RESTful Web Service
REST to RESTful Web Service
家弘 周
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
Lorna Mitchell
 
PHP and Web Services
PHP and Web ServicesPHP and Web Services
PHP and Web Services
Bruno Pedro
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
shilpi nagpal
 
Ad

Similar to Web services soap and rest by mandakini for TechGig (20)

Web Programming
Web ProgrammingWeb Programming
Web Programming
VijayapriyaP1
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics
Testing World
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)
Sascha Wenninger
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and Lies
Paul Fremantle
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
Luqman Shareef
 
Rest web service
Rest web serviceRest web service
Rest web service
Hamid Ghorbani
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Kevin Lee
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
rporwal
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
Rafiq Ahmed
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOA
Subin Sugunan
 
Service Oriented Architecture Updated Luqman
Service Oriented Architecture Updated  LuqmanService Oriented Architecture Updated  Luqman
Service Oriented Architecture Updated Luqman
guesteb791b
 
Web services - REST and SOAP
Web services - REST and SOAPWeb services - REST and SOAP
Web services - REST and SOAP
Compare Infobase Limited
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
Sreekanth Narayanan
 
Day03 api
Day03   apiDay03   api
Day03 api
ABDEL RAHMAN KARIM
 
Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservices
Anil Yadav
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
rainynovember12
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
Christian Guenther
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
Mindfire Solutions
 
How APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile EnvironmentsHow APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile Environments
WSO2
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web services
Iurii Kutelmakh
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics
Testing World
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)
Sascha Wenninger
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and Lies
Paul Fremantle
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
Luqman Shareef
 
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Exchange of data over internet using web service(e.g., soap and rest) in SAS ...
Kevin Lee
 
Restful web-services
Restful web-servicesRestful web-services
Restful web-services
rporwal
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
Rafiq Ahmed
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOA
Subin Sugunan
 
Service Oriented Architecture Updated Luqman
Service Oriented Architecture Updated  LuqmanService Oriented Architecture Updated  Luqman
Service Oriented Architecture Updated Luqman
guesteb791b
 
Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservices
Anil Yadav
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
Mindfire Solutions
 
How APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile EnvironmentsHow APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile Environments
WSO2
 
Time to REST: testing web services
Time to REST: testing web servicesTime to REST: testing web services
Time to REST: testing web services
Iurii Kutelmakh
 
Ad

More from Mandakini Kumari (10)

Emerging Trends In Cloud Computing.pptx
Emerging Trends In Cloud Computing.pptxEmerging Trends In Cloud Computing.pptx
Emerging Trends In Cloud Computing.pptx
Mandakini Kumari
 
Building an Edge Computing Strategy - Distributed infrastructure.pptx
Building an Edge Computing Strategy - Distributed infrastructure.pptxBuilding an Edge Computing Strategy - Distributed infrastructure.pptx
Building an Edge Computing Strategy - Distributed infrastructure.pptx
Mandakini Kumari
 
Emerging Trends in Cloud Computing.pptx
Emerging Trends in Cloud Computing.pptxEmerging Trends in Cloud Computing.pptx
Emerging Trends in Cloud Computing.pptx
Mandakini Kumari
 
Women in IT & Inspirational Individual of the Year.pptx
Women in IT & Inspirational Individual of the Year.pptxWomen in IT & Inspirational Individual of the Year.pptx
Women in IT & Inspirational Individual of the Year.pptx
Mandakini Kumari
 
Big data with hadoop Setup on Ubuntu 12.04
Big data with hadoop Setup on Ubuntu 12.04Big data with hadoop Setup on Ubuntu 12.04
Big data with hadoop Setup on Ubuntu 12.04
Mandakini Kumari
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
Mandakini Kumari
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
Mandakini Kumari
 
Drupal7 an introduction by ayushiinfotech
Drupal7 an introduction by ayushiinfotechDrupal7 an introduction by ayushiinfotech
Drupal7 an introduction by ayushiinfotech
Mandakini Kumari
 
Introduction of drupal7 by ayushi infotech
Introduction of drupal7 by ayushi infotechIntroduction of drupal7 by ayushi infotech
Introduction of drupal7 by ayushi infotech
Mandakini Kumari
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotech
Mandakini Kumari
 
Emerging Trends In Cloud Computing.pptx
Emerging Trends In Cloud Computing.pptxEmerging Trends In Cloud Computing.pptx
Emerging Trends In Cloud Computing.pptx
Mandakini Kumari
 
Building an Edge Computing Strategy - Distributed infrastructure.pptx
Building an Edge Computing Strategy - Distributed infrastructure.pptxBuilding an Edge Computing Strategy - Distributed infrastructure.pptx
Building an Edge Computing Strategy - Distributed infrastructure.pptx
Mandakini Kumari
 
Emerging Trends in Cloud Computing.pptx
Emerging Trends in Cloud Computing.pptxEmerging Trends in Cloud Computing.pptx
Emerging Trends in Cloud Computing.pptx
Mandakini Kumari
 
Women in IT & Inspirational Individual of the Year.pptx
Women in IT & Inspirational Individual of the Year.pptxWomen in IT & Inspirational Individual of the Year.pptx
Women in IT & Inspirational Individual of the Year.pptx
Mandakini Kumari
 
Big data with hadoop Setup on Ubuntu 12.04
Big data with hadoop Setup on Ubuntu 12.04Big data with hadoop Setup on Ubuntu 12.04
Big data with hadoop Setup on Ubuntu 12.04
Mandakini Kumari
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
Mandakini Kumari
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
Mandakini Kumari
 
Drupal7 an introduction by ayushiinfotech
Drupal7 an introduction by ayushiinfotechDrupal7 an introduction by ayushiinfotech
Drupal7 an introduction by ayushiinfotech
Mandakini Kumari
 
Introduction of drupal7 by ayushi infotech
Introduction of drupal7 by ayushi infotechIntroduction of drupal7 by ayushi infotech
Introduction of drupal7 by ayushi infotech
Mandakini Kumari
 
Drupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotechDrupal 7 theme by ayushi infotech
Drupal 7 theme by ayushi infotech
Mandakini Kumari
 

Recently uploaded (20)

Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 

Web services soap and rest by mandakini for TechGig

  • 1. Mandakini Kumari June 15th 2012
  • 2. Who am I  Have 9 + years of experience in open source specially PHP, Drupal & Web Services.  Active crusader to improve effectiveness and reach of Free & Open Source Software(FOSS).  Impart industrial consultancy for best use of software application.  Frequently conduct training for students and industrial experts.
  • 3. What am I going to talk about ?  Use of Web Services ?  What is Web Services  Different Ways: SOAP & REST  SOAP Vs REST  How am I going to use REST  Example: Twitter, Paypal
  • 4. Use of Web Services(WS)  Payment Gateway integration for E-commerce site.  Google Map for a Real Estate Site.  Product detail for a price comparison website  Weather forecast for a news or blog site  Mashup: Combine data from one or more source and integrate application
  • 5. Payment Gateway integration http://paypal.com
  • 6. Why WS for Payment getaway  Very Fast  Very Reliable  Secure  User don’t know what getway used by the site  User don’t need to register on payment site e.g. paypal  Website Administration is very easy e.g. IRCT with netbanking ICICI
  • 7. Google Map Web services for your website
  • 8. Top APIs for Mashups http://programmableweb.com/apis
  • 9. What is Web Services(WS)  WS serves as an interface to software developers.  Using WS as an API you can convert applications into web-applications.  WS is the vision of ‘Future Internet’  The basic Web services platform is XML + HTTP.  WS is future for Mobile application
  • 11. What is SOAP  SOAP is a simple XML-based protocol to let applications exchange information over HTTP  Businesses can register their WS on UDDI(Universal Description, Discovery and Integration) and provide documentation with WSDL (Web Services Description Language).  SOAP is mostly used for Enterprise applications to integrate wide types and another trend is to integrate with legacy systems
  • 15. A SOAP Envelope  <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> .... </soap:Envelope>
  • 16. SOAP Header Element  <SOAP-ENV:Header> <RequesterCredentials xmlns=”urn:ebay:api:PayPalAPI” xsi:type=”ebl:CustomSecurityHeaderType”> <Credentials xmlns=”urn:ebay:apis:eBLBaseComponents” xsi:type=”ebl:UserIdPasswordType”> <Username>api_username</Username> <Password>api_password</Password> <Signature>api_signature</Signature> <Subject>authorizing_account_emailaddress</Subject> </Credentials> </RequesterCredentials> </SOAP-ENV:Header>
  • 17. SOAP Body Request Element  <soap:Body> <m:GetPrice mlns:m="http://www.example.com/prices"> <m:Item>Laptop</m:Item> </m:GetPrice> </soap:Body>
  • 18. A SOAP Response  HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPriceResponse xmlns:m="http://www.example.com/prices"> <m:Price>$900</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
  • 19. PHP SOAP Server Example $server = new SoapServer("Library.wsdl",array("classmap"=>$classmap)); $server->addFunction("searchAuthors"); $server->addFunction("searchBooks"); $server->handle();
  • 20. PHP SOAP Client Example $client=new SoapClient("http://localhost/Library.wsdl",array("trace" => 1)); try { //$response = $client->searchAuthors("Beh"); $response = $client->searchBooks("te"); var_dump($response); echo htmlspecialchars($client->__getLastRequest()).""; echo htmlspecialchars($client->__getLastResponse()).""; }catch(Exception $e){ var_dump($e); echo $client->__getLastRequest(); echo $client->__getLastResponse(); }
  • 21. RESTful Web services  Representational State Transfer (REST) has gained widespread acceptance across the Web  REST permits many different data formats  HTTP consists in URIs, methods, status codes …  REST is great for clean, simple, robust services  REST is a software architecture style used in developing stateless web services  REST is an acronym standing for Representational State Transfer.
  • 23. RESTful Web Service HTTP methods HTTP CRUD SQL POST Create INSERT GET Read SELECT PUT Update UPDATE DELETE Delete DELETE
  • 24. Data Format Supported By REST  xml – almost any programming language can read XML  json – useful for JavaScript and increasingly PHP apps.  csv – open with spreadsheet programs  html – a simple HTML table  php – Representation of PHP code that can be eval()’ed  serialize – Serialized data that can be unserialized in PHP
  • 25. Different Methods to Interact with REST  file_get_contents()  cURL  SimpleXml
  • 26. 1) File_get_contents() <?php $result = file_get_contents('http:// twitter .com/users/show/screenname'); var_dump($result); HTTP Basic authentication you can use the following syntax to get data from your password protected RESTful AP $user = json_decode( file_get_contents('http://admin:[email protected]/index.php/api/use r/id/1/format/json') ); echo $user->name;
  • 27. REST from PHP: GET(CURL) <?php $ch = curl_init('http://twitter.com/users'); curl_exec($ch);
  • 28. REST from PHP: DELETE <?php $ch = curl_init('http://example.com/users/ginny'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_exec($ch);
  • 30. Why REST /1  Creating clients, developing APIs, and understanding documentation is much easier in REST than SOAP  REST permits many different data formats where as SOAP only permits XML  JSON is a better fit for data and parses very faster  REST allows better support for browser clients due to it’s support for JSON  REST reads can be cached, SOAP based reads cannot be cached.  REST has better performance and scalability.
  • 31. Why SOAP /2  WS-Security: SOAP supports SSL (just like REST) it also supports WS-Security which adds some enterprise security features.  WS-AtomicTransaction: Need ACID Transactions over a service then you need SOAP. While REST supports transactions, it isn’t as comprehensive and isn’t ACID compliant  WS-ReliableMessaging: Rest doesn’t have a standard messaging system and expects clients to deal with communication failures by retrying. SOAP has successful/retry logic built in and provides end-to-end reliability even through SOAP intermediaries.
  • 32. SOAP Vs REST /3  In Summary, SOAP is clearly useful, and important. For instance, if I was writing an iPhone application to interface with my bank I would definitely need to use SOAP. All three features above are required for banking transactions. For example, if I was transferring money from one account to the other, I would need to be certain that it completed. Retrying it could be catastrophic if it succeed the first time, but the response failed.