SlideShare a Scribd company logo
Web Services The Next Generation Web Technology
Contents Overview What are web services What are the uses of web services How they implement Basics of SOAP and XML Why use PHP One sample application
Overview In a Normal web surfing scenario, a visitor visits a website and use the functionality provided by that particular website. User sends HTTP request to server from web browsers and server taken user’s request, processed and send response back to the user through browser. This is the process of website surfing by end user. Ex:  www.inkakinada.com  will provide lot of services to the end users like movies, news, jobs etc., information.
Overview Here, we cant get the  www.inkakinada.com  services by visiting  www.nyros.com . Am I right? But it is also possible with web services, the name it self gives the meaning. Services provided by web. What exactly means You don’t need to visit the particular website to use their service and functionality if they are providing web services   So Web services are used to share the resource among the websites.
What are web services? Web services  are the set of platform independent exposed functions which can be used to share logic (or data) across many websites, platforms and hardware configurations. Hence web services are platform independent and language independent. Means JAVA web services can be used PHP Developers and vice versa. There are two parties involved in web services, one is web service provider and other called web service consumer.
Uses of web services? Exposing your existing functionality through out the web with no cost Retrieve information dynamically over the web Connecting Different Applications i.e Interoperability No Cost for communication
How they implement? There are different methods available for developing web services but below three are the most common methods   SOAP  XML–RPC  REST SOAP is the best choice for PHP Developers to develop Web services
SOAP SOAP  is the acronym of  Simple Object Access Protocol. It is a transport   protocol for the client request to the web service and response to the client from web service.  Web services uses the language XML to encode and decode your data and used the transport protocol SOAP to transport xml data between client and server.   Nusoap  is the toolkit of PHP for providing and consuming web services using SOAP in PHP .
XML Web services send and receive data in the form of Extensible Markup Language (XML), which travel via Simple Object Access Protocol (SOAP). XML [Extensible markup language]  is a language which can be used for share information between different applications irrespective of platforms [windows / Linux etc] and languages [JAVA / PHP / .NET / ROR etc]. Hence XML is platform independent and language independent.
Why use PHP Already a very popular for web development XML support CURL support OOP SOAP extension etc.,  Lot of important tools available freely
Sample Application Here we implement one sample application which provides STD code for the city. Assume one website which contains all the cities zip codes. So he would like to provide this resources through out the web to the people who wants to find zip codes for the cities. First he create one web service in his website.
Code  for creating service include("nusoap.php"); include("dbconfig.php"); $server = new soap_server(); $server->register("getSTD"); function getSTD($city) { $query="select * from cities where cityname=$city"; $res=mysql_query($query); $rs=mysql_fetch_assoc($res); $output=$rs['std_code']; return array("data"=>"$output "); } Here $ output  will have the STD code for the city passed as  parameter......
Code for Calling Service include("nusoap.php"); $soap = new soapclient_nusoap("http://example.com/webservice.php"); $args = array('city'=>'kakinada'); $output = $soap->call("getSTD",$args); print_r($output);//it gives output as array
What is missing? What happened If you don't pass a City name? If you don’t pass currect city name If the database doesn’t contain result with the city name you passed even it is correct SOAP Fault generation  is the solution
SOAP FAULT Just change you service code include("nusoap.php"); include("dbconfig.php"); $server = new soap_server(); $server->register("getSTD"); function getSTD($city) { $query="select * from cities where cityname=$city"; $res=mysql_query($query); $rs=mysql_fetch_assoc($res); $output=$rs['std_code']; If($city==‘’ OR $output==‘’){return new soap_fault(‘Must supply valid city name’) } else { return array("data"=>"$output "); } }
SOAP Work Here Soap transfer the request and response very securely. Soap packed the message securely and called it as soap envelop which contains 3 parts as below  1. Soap header, 2. Soap body, 3. Soap fault  Soap header will contain any additional information to be send along with method call, like authentication information, security info etc, soap body will contain actual web service method call information with necessary parameters or result of method execution  soap fault will contain error info
Alternate Methods XML-RPC [Remote Procedure Call] Another way of providing and consuming web services. It uses XML to encode and decode the remote procedure call along with it’s parameter. You can visit the official website  www.xmlrpc.com  to know more about XML-RPC. REST Representational State Trasfer(REST) is comparatively simpler method for providing and consuming web services. It is not necessary to use XML as a data interchange format in REST. To know more about REST visit  http://www.crummy.com/writing/RESTful-Web-Services/
Soap References SOAP and web services reference sites: http://www.xml.com/pub/a/2001/04/04/webservices/ http://www.w3c.org/tr/soap http://www.w3schools.com/SOAP/soap_intro.asp
XML References http://www.w3schools.com/xml/default.asp http://www.w3.org/XML/ http://www.xml.com/ http://www.xml.org/
GOOD LUCK

More Related Content

PDF
Building Applications Using Ajax
PDF
Ninad cucumber rails
PDF
PHP and Web Services
ODP
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
PDF
SOAP-based Web Services
PPT
RESTful services
PDF
Creating native apps with WordPress
PPT
09 Oo Php Register
Building Applications Using Ajax
Ninad cucumber rails
PHP and Web Services
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
SOAP-based Web Services
RESTful services
Creating native apps with WordPress
09 Oo Php Register

Viewers also liked (9)

PPTX
Webservices Workshop - september 2014
PPTX
WebServices Basic Introduction
PPT
Introduction of WebServices
PPTX
Android - Consumindo Webservices
PDF
Web Service Testing using TestComplete
PPT
Webservices
PPTX
WebServices
PPTX
Testing web services
PPTX
Webservices Overview : XML RPC, SOAP and REST
Webservices Workshop - september 2014
WebServices Basic Introduction
Introduction of WebServices
Android - Consumindo Webservices
Web Service Testing using TestComplete
Webservices
WebServices
Testing web services
Webservices Overview : XML RPC, SOAP and REST
Ad

Similar to Webservices (20)

PPTX
Web services
PPTX
Web services
PDF
Php and-web-services-24402
PDF
Web services and Applications in Web Technology.pdf
PPT
Web Services - Lectures and architecture.ppt
ODP
Web service Introduction
PDF
Php And Web Services
PPTX
Web services soap and rest by mandakini for TechGig
PPTX
Web Services - A brief overview
PPT
Web Service
PPTX
Web service- Guest Lecture at National Wokshop
PPT
Mule webservices in detail
DOCX
Rest vs soap
PPTX
Web services
PPT
Php Asp Net Interoperability Rc Jao
PPTX
Web Programming
DOCX
Web services Concepts
PPT
web services-May 25.ppt
Web services
Web services
Php and-web-services-24402
Web services and Applications in Web Technology.pdf
Web Services - Lectures and architecture.ppt
Web service Introduction
Php And Web Services
Web services soap and rest by mandakini for TechGig
Web Services - A brief overview
Web Service
Web service- Guest Lecture at National Wokshop
Mule webservices in detail
Rest vs soap
Web services
Php Asp Net Interoperability Rc Jao
Web Programming
Web services Concepts
web services-May 25.ppt
Ad

More from Nyros Technologies (20)

PPT
MVC Architecture in ASP.Net By Nyros Developer
PPT
Web Designing Bugs - Fixes By Nyros Developer
PPT
Capistrano Deployment By Nyros Developer
PPT
Silver Light By Nyros Developer
PPT
Web 2.0 Design Standards By Nyros Developer
PPT
Web 2.0 By Nyros Developer
PPT
Caching By Nyros Developer
PPT
Language Integrated Query By Nyros Developer
PPT
New Features in .Net Framework 4.0 By Nyros Developer
PPT
Oops in PHP By Nyros Developer
PPT
Connect with Facebook to Rails Application By Nyros Developer
PPT
Github By Nyros Developer
PPT
Research on Audio and Video Streaming
PPT
User Interface
PPT
Audio and Video Streaming
PPT
Deploying Rails Apps with Capistrano
PPT
Capistrano - Deployment Tool
PPT
Social Networking
PPT
Payment Gateway
MVC Architecture in ASP.Net By Nyros Developer
Web Designing Bugs - Fixes By Nyros Developer
Capistrano Deployment By Nyros Developer
Silver Light By Nyros Developer
Web 2.0 Design Standards By Nyros Developer
Web 2.0 By Nyros Developer
Caching By Nyros Developer
Language Integrated Query By Nyros Developer
New Features in .Net Framework 4.0 By Nyros Developer
Oops in PHP By Nyros Developer
Connect with Facebook to Rails Application By Nyros Developer
Github By Nyros Developer
Research on Audio and Video Streaming
User Interface
Audio and Video Streaming
Deploying Rails Apps with Capistrano
Capistrano - Deployment Tool
Social Networking
Payment Gateway

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.

Webservices

  • 1. Web Services The Next Generation Web Technology
  • 2. Contents Overview What are web services What are the uses of web services How they implement Basics of SOAP and XML Why use PHP One sample application
  • 3. Overview In a Normal web surfing scenario, a visitor visits a website and use the functionality provided by that particular website. User sends HTTP request to server from web browsers and server taken user’s request, processed and send response back to the user through browser. This is the process of website surfing by end user. Ex: www.inkakinada.com will provide lot of services to the end users like movies, news, jobs etc., information.
  • 4. Overview Here, we cant get the www.inkakinada.com services by visiting www.nyros.com . Am I right? But it is also possible with web services, the name it self gives the meaning. Services provided by web. What exactly means You don’t need to visit the particular website to use their service and functionality if they are providing web services So Web services are used to share the resource among the websites.
  • 5. What are web services? Web services are the set of platform independent exposed functions which can be used to share logic (or data) across many websites, platforms and hardware configurations. Hence web services are platform independent and language independent. Means JAVA web services can be used PHP Developers and vice versa. There are two parties involved in web services, one is web service provider and other called web service consumer.
  • 6. Uses of web services? Exposing your existing functionality through out the web with no cost Retrieve information dynamically over the web Connecting Different Applications i.e Interoperability No Cost for communication
  • 7. How they implement? There are different methods available for developing web services but below three are the most common methods SOAP XML–RPC REST SOAP is the best choice for PHP Developers to develop Web services
  • 8. SOAP SOAP is the acronym of Simple Object Access Protocol. It is a transport protocol for the client request to the web service and response to the client from web service. Web services uses the language XML to encode and decode your data and used the transport protocol SOAP to transport xml data between client and server. Nusoap is the toolkit of PHP for providing and consuming web services using SOAP in PHP .
  • 9. XML Web services send and receive data in the form of Extensible Markup Language (XML), which travel via Simple Object Access Protocol (SOAP). XML [Extensible markup language] is a language which can be used for share information between different applications irrespective of platforms [windows / Linux etc] and languages [JAVA / PHP / .NET / ROR etc]. Hence XML is platform independent and language independent.
  • 10. Why use PHP Already a very popular for web development XML support CURL support OOP SOAP extension etc., Lot of important tools available freely
  • 11. Sample Application Here we implement one sample application which provides STD code for the city. Assume one website which contains all the cities zip codes. So he would like to provide this resources through out the web to the people who wants to find zip codes for the cities. First he create one web service in his website.
  • 12. Code for creating service include("nusoap.php"); include("dbconfig.php"); $server = new soap_server(); $server->register("getSTD"); function getSTD($city) { $query="select * from cities where cityname=$city"; $res=mysql_query($query); $rs=mysql_fetch_assoc($res); $output=$rs['std_code']; return array("data"=>"$output "); } Here $ output will have the STD code for the city passed as parameter......
  • 13. Code for Calling Service include("nusoap.php"); $soap = new soapclient_nusoap("http://example.com/webservice.php"); $args = array('city'=>'kakinada'); $output = $soap->call("getSTD",$args); print_r($output);//it gives output as array
  • 14. What is missing? What happened If you don't pass a City name? If you don’t pass currect city name If the database doesn’t contain result with the city name you passed even it is correct SOAP Fault generation is the solution
  • 15. SOAP FAULT Just change you service code include("nusoap.php"); include("dbconfig.php"); $server = new soap_server(); $server->register("getSTD"); function getSTD($city) { $query="select * from cities where cityname=$city"; $res=mysql_query($query); $rs=mysql_fetch_assoc($res); $output=$rs['std_code']; If($city==‘’ OR $output==‘’){return new soap_fault(‘Must supply valid city name’) } else { return array("data"=>"$output "); } }
  • 16. SOAP Work Here Soap transfer the request and response very securely. Soap packed the message securely and called it as soap envelop which contains 3 parts as below 1. Soap header, 2. Soap body, 3. Soap fault Soap header will contain any additional information to be send along with method call, like authentication information, security info etc, soap body will contain actual web service method call information with necessary parameters or result of method execution soap fault will contain error info
  • 17. Alternate Methods XML-RPC [Remote Procedure Call] Another way of providing and consuming web services. It uses XML to encode and decode the remote procedure call along with it’s parameter. You can visit the official website www.xmlrpc.com to know more about XML-RPC. REST Representational State Trasfer(REST) is comparatively simpler method for providing and consuming web services. It is not necessary to use XML as a data interchange format in REST. To know more about REST visit http://www.crummy.com/writing/RESTful-Web-Services/
  • 18. Soap References SOAP and web services reference sites: http://www.xml.com/pub/a/2001/04/04/webservices/ http://www.w3c.org/tr/soap http://www.w3schools.com/SOAP/soap_intro.asp
  • 19. XML References http://www.w3schools.com/xml/default.asp http://www.w3.org/XML/ http://www.xml.com/ http://www.xml.org/