BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
PHP XML
PHP XML RPC Function GetType
PHP XML RPC Function EncodeRequest
PHP XML RPC Function Encode
PHP XML RPC Function DecodeRequest
PHP DOMXPath Function registerNamespace
PHP DOMXPath Function query
PHP DOMText Function splitText
PHP DOMText Function isWhitespaceInElementContent
PHP DOMNode Function replaceChild
PHP DOMNode Function lookupPrefix
PHP DOMNode Function lookupNamespaceURI
PHP DOMNode Function isSupported
PHP DOMNode Function isSameNode
PHP DOMNode Function insertBefore
PHP DOMNode Function hasChildNodes
PHP DOMNode Function hasAttributes
PHP DOMNode Function cloneNode
PHP DOMNodelist Function item
PHP DOMNamedNodeMap Function item
PHP DOMNamedNodeMap Function getNamedItemNS
 
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :186

 

PHP XML RPC Function ServerCreate

PHP Version: (PHP 4 >= 4.1.0, PHP 5)

Description

This function is used to create a RPC server. The server can then be used for serving your request.

Usage:

resource xmlrpc_server_create ( void )

Using this method you can create a server. The basic steps for implementation of server in PHP are to create a server and register set of methods which can be used by this server. All methods can be registered by using xmlrpc_server_register_method() function. A function registers with the server with a name that can be viewed from outside world.

Please find the code below for creating a server and registering a function with the server.

PHP Code:

<?php

//This method will be invoked by the server.

function dummyresponse($method, $params) {

switch($params[0]) {

case 'test1':

$reply = 'Your request string contains test1.';

break;

case 'test2':

$reply = 'Your request string contains test2.';

break;

default:

$reply = 'You have requested with no parameters';

}

return $reply;

}

//create a server

$server = xmlrpc_server_create();

//register the 'dummyserver' name as external name and then the 'dummyresponse' name is the actual

//function name.

xmlrpc_server_register_method($server, "dummyserver", "dummyresponse");

//get the request.

$request = $HTTP_RAW_POST_DATA;

//the parameters here are 'server, xml-string and user data'.

$response = xmlrpc_server_call_method($server, $request, null);

//set the header as text/html

header('Content-Type: text/xml');

//print the response

print $response;

//destroy the server

xmlrpc_server_destroy($server);

?>


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

View all Jobs (Add yours)
View all CV (Add yours)



free conference call
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
masks


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP