0% found this document useful (0 votes)
1 views37 pages

Laravel - Soap

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 37

Laravel – Webservices - SOAP

Contents
 What is a Web-service?
 What is WSDL?
 What is WebService Protocol?
 What is SOAP?

Develop SOAPClient in laravel


1. Web-Service VS Web-Site
 A web-service is an application which is available on the internet and is used for information
gathering, i.e. weather predictions, tax information. Web-service has defined functions (APIs)
which are used/accessed to extract information. It has no Graphical User Interface.
 In contrast, a web-site is an application which has a Graphical User Interface. It allows user to
navigate through it graphically.
WSDL
WSDL ( Web Service Description Language ) describes functionality of a web-service following
some protocol i.e. SOAP version 1.1
2.1 WSDL Document Structure

SOURCE: WWW.TEQLOG.COM/WSDL-EXAMPLE-EXPLAINED-STEP-BY-STEP.HTML
WSDL Elements
Definition
This contains the attribute name, which in turn has the web service name.
◦ Types
This element uses the XML schema language to declare complex data types and elements that are used elsewhere in the WSDL document.
◦ Message
This element describes the message’s payload using XML schema built-in types, complex types.
◦ PortType / Interface and Operation
These elements describe a Web service’s interface and define its methods.

Binding
This element assigns a portType and its operation elements to a particular protocol (for instance, SOAP
1.1) and encoding style.
Service
This element is responsible for assigning an Internet address to a specific binding.

SOURCE: WWW.TEQLOG.COM/WSDL-EXAMPLE-EXPLAINED-STEP-BY-STEP.HTML
2.2 XML
 A WSDL document is written in XML (Extensible Markup Language).
 XML is used to describe complex datatypes.
 XML documents are passed by the server to client applications for fulfilling their data-requests.
What is a Protocol?
A protocol, in the domain of internet, defines how computers on the internet share information.
Types of protocols include
 HTTP (Hyper text Transfer Protocol)
 SOAP (Simple Object Access Protocol)
 Restful (Representational State transfer Protocol )

Each Protocol serves specific purpose i.e.


 HTTP is defined for formatted document transfer
 SOAP and restful are designed for data-sharing
2. SOAP
 SOAP stands for Simple Object Access Protocol.
 This protocol is usually used for Web-services.
Laravel SOAPCLIENT Application
- STEPS
 Create laravel application
 Enable SOAP services in PHP
 Design SOAPcontroller in laravel
Create Project
>> cd E:\xampp\htdocs\
>> composer create-project laravel/laravel test_soap “5.1.*”
Enable soap service in PHP
 Go to
E:\xampp\php\php.ini
 Uncomment ; before this statement
;extension=php_soap.dll
 Restart the xampp’s apache server
Define routes.php
Create SOAPController
RUN LARAVEL BASED SOAP-
CLIENT
WSDL files of Web-services
Reference:
Please read/consult w3school.com to further understand the topic
Thank You!

You might also like