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

Flash Database: PHP for Reading Data »

Web Services .NET Grid: Create SOAP Server


Web Services PHP - Grid .NET Step By Step Tutorial - Part 3: Our database and WSDL document are ready. Now, we create SOAP server to serve transmit data. All data will be convert to single line of string.

Create a file named "library_server.php" within www/test/wsdl. Enter following code:

<?php
if(!extension_loaded("soap")){
  dl("php_soap.dll");
}

ini_set("soap.wsdl_cache_enabled","0");
$server = new SoapServer("library.wsdl");

function doLibrary($name=''){
 // connect to database
 mysql_connect('localhost','root','admin');
 mysql_select_db('test');
 
 // query for retrieve data from books table
 $sql = "select * from books";
 $q	  = mysql_query($sql);
 
 while($r	  = mysql_fetch_array($q)){
   // convert to a line
   $str .= $r['id']."|".$r['title'].'|'.$r['author'];
   // row be separated with #
   $str .= '#';
 }

 // return a line of string
 return $str;
   
}

// register method
$server->AddFunction("doLibrary");
$server->handle();
?>


Series this article:
Web Services .NET Grid: Create WSDL Document
Web Services .NET Grid: Preparing Database
Web Services .NET Grid: Create SOAP Server
Web Services .NET Grid: Testing with SOAP client
Web Services .NET Grid: Creating User Interface for VB.NET
Web Services .NET Grid: Retrieve Data and Show to Data Grid


Tag: web services, .net, wsdl, soap, vb.net Category: PHP Framework Post : April 15th 2008 Read: 1,344 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