Services API and Flex Applications By: sumitk http://sumitk.net
Services
An API which helps integrating external applications with Drupal
Service callbacks may be used with multiple interfaces like XMLRPC, SOAP, REST, AMFPHP.
Servers for Services API
XMLRPC (in core)
REST
SOAP
AMFPHP
Services included ServicesAPI
node.load(node_load)
node.save
node.delete(means all node services)
file service
menu service
system service
taxonomy service
user service
views service(I know everyone is exited about it ;) you can get, exportOR import a view)
Authentication layer over ServicesAPI
Keys method(got to register app. with a key and then include that key in service request)
SessionID method (use user’s sessionID for authentication)
OAuth method – NOT in core right now but patch is ready ;) we can use it any time :)
HOW call looks like $change = array ( "nid" => 14 , //required for update "revision" => time () , //required for update "changed" => time () , //required for update "type" => "page" , //required "uid" => 1 , //required both uid and name to associate to a user "name" => "user1" , //required both uid and name to associate to a user "title" => "TEST NODE.SAVE TITLE **UPDATES**" , "status" => 1 , // = published "body" => "this is a body **UPDATES**" , ) ; print_nice ( $change ) ; $m = new xmlrpcmsg ( 'node.save' , array ( php_xmlrpc_encode ( $sessid ) , php_xmlrpc_encode ( $change ) ) ) ; $c = new xmlrpc_client ( "?q=services/xmlrpc" , "localhost" , 80 ) ;
AMFPHP : server to connect ServicesAPI and Adobe Flex/Flash
What is AMFPHP?? AMFPHP is a free open-source PHP implementation of the Action Message Format(AMF). It acts as a binary gateway to pass your data through & send it to FLEX/FLASH in an insane speed. So this project actually connects our drupal and flex application.
0 comments
Post a comment