PHPEveryday.com PHP and Web Development Tutorial
What are you looking for?


PHP WDDX: Creating Web Service Client


Web Distributed Data Exchange Step By Step tutorial - Part 12: Ok, this is last post in wddx series. We will create code for web service client side.

Create a file named "client.php" within www/test/wddx. Enter following code:

<?php
$remote_server = "http://localhost/test/wddx/server.php";
$fo = fopen($remote_server,"r");
$arrData = wddx_deserialize($fo);

?>
<html>
  <head>
    <title>WDDX Client</title>
  </head>
  <body>
    <table>
      <tr>
        <th>Id</th>
        <th>Title</th>        
        <th>Author</th>        
        <th>Description</th>        
      </tr>
<?  foreach($arrData as $k=>$v){ ?>
      <tr>
        <td><?=$v['id']?></td>
        <td><?=$v['title']?></td>        
        <td><?=$v['author']?></td>        
        <td><?=$v['description']?></td>        
      </tr>
<?  } ?>      
    </table>
  </body>
</html>

Now, test it. Point your browser to http://localhost/test/wddx/client.php.

It is simple, isn't it?



Series this article:
PHP WDDX: Introduction
PHP WDDX: Understanding Anatomy of WDDX
PHP WDDX: Understanding Data Elements
PHP WDDX: Understanding Simple Data Type
PHP WDDX: Using Array Elements
PHP WDDX: Struct Element
PHP WDDX: Recordset Element
PHP WDDX: Simple Serialization Using PHP function
PHP WDDX: Complex Serialization
PHP WDDX: Unserializing Data
PHP WDDX: Creating Web Service Server
PHP WDDX: Creating Web Service Client


Tag: wddx. distributed data, web service, client Category: PHP Application Post : April 30th 2008 Read: 3,923 Bookmark and Share

blog comments powered by Disqus


Database Tutorial
  • Learn PHP MySQL
  • Learn PHP ADOdb
  • Learn PHP Data Object/PDO
  • Learn PHP XML
  • Learn PHP SimpleXML
Security Tutorial
  • Learn PHP Security
  • Learn HTTP Authentication
  • Learn PHPSecureSite
Framework Tutorial
  • Learn CodeIgniter
  • Learn Joomla
  • Learn Smarty
  • Learn Zend Framework
Template Tutorial
  • Learn Joomla Template
  • Learn WordPress Template
API Tutorial
  • Learn Facebook
JS Framework Tutorial
  • Learn MooTools
  • Learn JQuery
AJAX Tutorial
  • Learn AJAX in 10 Minutes
  • Learn AJAX Client Side
  • Learn AJAX PHP
  • Learn AJAX Remote Server
  • Learn AJAX Repetitive
  • Learn AJAX MySQL
  • Learn AJAX Grid
Web Services Tutorial
  • Learn Web Services NuSOAP
  • Learn Web Services WSDL
  • Learn Web Services WSDL Array
  • Learn Web Services .NET Grid
  • Learn Web Services WDDX
Package Post
  • Joomla Intro
  • Joomla Component
  • Joomla Module
  • Joomla MVC
  • Joomla MVC Backend
  • PostNuke Intro
  • Zend Framework Intro
  • Zend Framework Action
  • Zend Framework Database
  • Zend Framework Registry
  • Zend Framework Config
  • Zend Framework Login
  • Zend Framework Session
  • PHP Array Tips
  • PHP File Tips
  • PHP Email
  • PHP Ms Excel
  • PHP Pattern
  • PHP SMS
  • Flash Database
  • PHP Multitier
  • jQuery Introduction
  • jQuery Selectors
  • Portable Web Server
  • Web Mobile Intro
  • Drupal Installation
  • Drupal Configuration