Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

31. Web Services (SOAP, RSS & REST)

Lesson 28 of 29 in the free PHP Programming notes on Siksha Sarovar, written by Rohit Jangra.

Web Services

What is a Web Service?

A Web Service is a software system that allows different applications to communicate with each other over the internet, regardless of the programming language or platform.

Exam Definition: A web service is a standardized way of enabling communication between applications using web protocols.

Why Web Services are Needed

Modern applications are distributed and need to share data.

Reasons for Using Web Services

  • Platform independent communication
  • Language independent integration
  • Data sharing between systems
  • Remote access to services
  • Used in APIs, mobile apps, cloud systems

Real-Time Examples

  • Payment gateways
  • Weather APIs
  • Social media APIs
  • Online maps
Exam Line: Web services enable interoperability between different systems.

---

Types of Web Services

  1. SOAP Web Services
  2. REST Web Services
  3. RSS Feeds

(For exams, SOAP and RSS are most important.)

---

RSS (Really Simple Syndication)

What is RSS?

RSS is a web feed format used to publish frequently updated information such as news, blogs, or notifications.

Exam Definition: RSS is an XML-based format used to distribute updated web content automatically.

RSS Syntax

RSS documents are written in XML format.

Basic RSS Structure

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>My Website</title>
    <link>https://example.com</link>
    <description>Latest Updates</description>

    <item>
      <title>News Title</title>
      <link>https://example.com/news1</link>
      <description>News description</description>
    </item>

  </channel>
</rss>

Important RSS Tags

TagPurpose
<rss>Root element
<channel>Feed information
<title>Title of feed/item
<link>URL
<description>Description
<item>Individual content
Exam Tip: RSS feeds are written using XML.

---

SOAP (Simple Object Access Protocol)

What is SOAP?

SOAP is a protocol for exchanging structured information using XML over HTTP.

Exam Definition: SOAP is an XML-based protocol used for communication between applications.

Features of SOAP

  • Uses XML only
  • Platform independent
  • Works over HTTP, SMTP
  • Supports security and transactions

SOAP Message Structure

<soap:Envelope>
  <soap:Header/>
  <soap:Body>
     <!-- Request or Response -->
  </soap:Body>
</soap:Envelope>

SOAP Components

ComponentDescription
EnvelopeRoot element
HeaderMetadata
BodyActual message
FaultError information
Exam Line: SOAP messages are always written in XML.

---

How to Access Web Services in PHP

PHP can access web services using built-in functions.

Accessing RSS / XML Web Services

Using simplexml_load_file()

$xml = simplexml_load_file("feed.xml");

foreach($xml->channel->item as $item){
   echo $item->title."<br>";
}

Accessing SOAP Web Services

Using SoapClient

$client = new SoapClient("service.wsdl");
$result = $client->getData();
Exam Tip: SoapClient is used to consume SOAP web services in PHP.