BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
PHP XML
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
PHP DOMNamedNodeMap Function getNamedItem
PHP DOMImplementation Function hasFeature
PHP DOMImplementation Function createDocumentType
PHP DOMImplementation Function createDocument
 
 

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 :211

 

PHP XML RPC Function DecodeRequest

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

Description

This function decodes xml into native php type.

Usage:

array xmlrpc_decode_request ( string xml, string &method [, string encoding])

This function decodes xml into native PHP type. After getting the response from server, it needs to be converted into PHP native types so that it can be used. This function returns an array which contains array of native type objects.

PHP Code:

<?php

function do_call($host, $port, $request) {

$fp = fsockopen($host, $port, $errno, $errstr);

$query = "POST /default/php/server.php HTTP/1.0\nUser_Agent: This is a Dummy Client\nHost: ".$host."\nContent-Type: text/xml\nContent-Length: ".strlen($request)."\n\n".$request."\n";

if (!fputs($fp, $query, strlen($query))) {

$errstr = "Write error";

return 0;

}

$contents = '';

while (!feof($fp)) {

$contents .=fgets($fp);

}

fclose($fp);

return $contents;

}

$host = 'localhost';

$port = 80;

$request = xmlrpc_encode_request('dummyserver', 'test1');

$response = do_call($host, $port, $request);

$variable ='test1';

//decode the response inti native PHP type

$decodedresponse = xmlrpc_decode_request($response,$variable);

//print the array

print_r( $decodedresponse);

?>


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

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



answering service
conference calls
swimming pool builder
cfxmasks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    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