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:

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

    <title>WDDX Client</title>
<?  foreach($arrData as $k=>$v){ ?>
<?  } ?>      

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

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


blog comments powered by Disqus