Webservices
connecting Joomla!
   with the rest




         Herman Peeren   June 1st 2010
Webservice:
•	   data-exchange with a webserver
•	   often in XML-format
Alternative: ODBC
directly calling the database from client-application




“normal”, indirect call, e.g. via   direct cal...
now: Webservices
Joomla!
as a
system
on its own
connecting
Joomla!
connecting
Joomla!
connecting
Joomla! to:
•	   desktop applications
     (RIAs), Java, Flex,
     Delphi, VS, Titanium,
     MS Office, etc.
...
Example uses:
•connecting to multiple Joomla!-
 sites for backup and upgrading.
 (e.g.: Akeeba Remote)

•using external se...
Protocols:
•your own...
•a binary protocol like AMF
•using some XML or JSON (Ajax)
•one way XML: feed (Atom/RSS)

•XML-RPC...
Remote Procedure Calls
(XML-RPC and SOAP)

•call a method on the server
•DO something (procedure, verb)

vs REST
•get/put/...
XML-RPC
•define I/O types
•phpxmlrpc-library
•in Joomla!: as a plugin...
•better: use MVC
•changed in J! 1.6
Webservice and MVC
•model: is the “heart” of application
 (use same model for webservice)
•controller decides what to do
 ...
XML-RPC in Joomla! 1.6
•no plugin anymore
•new JController
 (might use a strategy pattern?)
•controllername.xmlrpc.php
•id...
SOAP
•evolved from XML-RPC
•heavily used in .NET
•meta-data:
 WSDL and SOAP-envellope
•SOAP-header:
 a.o. for authenticati...
SOAP-envellope:
WSDL:
•description of a webservice
•automatic code generation!
•easy to use in e.g. Delphi, Flex, etc.
sample
SOAP-calls
and WSDL
importing WSDL in Delphi 2010:
importing WSDL in Flex Builder 3:
SOAP in Joomla!,
some possibilities:
•JMSOAP and com_connector: J!1.0
 (vBulletin-connection)
•VM SOA: SOAP for VirtueMart...
REST
•“representational state transfer”
•architecture, not a protocol
•linking to recourses, not methods
•resource = objec...
REST in Nooku Framework:
•KControllerBread + KRequest works
 out of the box!
•authentication and http status messa-
 ges n...
Authentication/Authorization
•with XML/RPC credentials are para-
 meters in the remote procedure call.

•with SOAP credent...
SSL or other encrypting
•SSL (https://) can be used to encrypt
 the credentials (and data)

•or you can define encryption ...
Get Joomla! connected
•providing standard, easy to use con-
 nections is essential for further deve-
 lopment of Joomla!

...
let’s
connect
Joomla!
let’s
connect
Joomla!
Questions?



Contact info:
Herman Peeren
herman@yepr.nl
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.
Prochain SlideShare
Chargement dans... 5
×

Webservices: connecting Joomla! with other programs.

35,758

Published on

Webservices: connecting Joomla! with other programs.

XML-RPC, SOAP and REST with Joomla!

Published in: Technologies
8 commentaires
7 mentions J'aime
Statistiques
Remarques
  • These slides were made in 2010, when Joomla 1.6 had just been released. A lot of the information in these slides is relevant for Joomla 1.5, but not anymore for 2.5+. For instance the native PHP5 SOAP possibilities are bettter available than 4 years ago. However, the main opinion I had then is still relevant: you should only have to change your view a little bit, but not your model.
       Répondre 
    Êtes-vous sûr de vouloir  Oui  Non
    Votre message apparaîtra ici
  • Hi Parth! Unfortunately I could not be at JAB12. Nice to hear Ashwin is participating in this workgroup too.

    Let's do further discussions about the workgroup on https://groups.google.com/forum/?fromgroups#!topic/joomla-dev-cms/dtSZxuwShAo
       Répondre 
    Êtes-vous sûr de vouloir  Oui  Non
    Votre message apparaîtra ici
  • Also Ashwin is taking part in the Joomla Web Services working group & was in the JAB12 working group session there. He will be able to shed some light on how this will eventually be part of the project.
       Répondre 
    Êtes-vous sûr de vouloir  Oui  Non
    Votre message apparaîtra ici
  • Hey guys, if you want to take a look at how the Techjoomla REST webservice works, you can see this http://www.slideshare.net/coolparth/rest-api-for-joomla

    We are already using this for multiple enterprise level projects as well as Mobile apps like http://reportoise.com
       Répondre 
    Êtes-vous sûr de vouloir  Oui  Non
    Votre message apparaîtra ici
  • YW, but this is from last year. In the mean time several new things have occurred with webservices and Joomla!, for example:

    * TechJoomla has a REST-API for Joomla: http://techjoomla.com/joomla-extension-news/joomla-rest-api.html

    * look at Seblod 2 for a SOAP-webservice!

    Please let me know if you have your app done; I'm curious!
       Répondre 
    Êtes-vous sûr de vouloir  Oui  Non
    Votre message apparaîtra ici
Aucun téléchargement
Vues
Total des vues
35,758
Sur Slideshare
0
À partir des ajouts
0
Nombre d'ajouts
2
Actions
Partages
0
Téléchargements
357
Commentaires
8
J'aime
7
Ajouts 0
No embeds

No notes for slide

Webservices: connecting Joomla! with other programs.

  1. 1. Webservices connecting Joomla! with the rest Herman Peeren June 1st 2010
  2. 2. Webservice: • data-exchange with a webserver • often in XML-format
  3. 3. Alternative: ODBC directly calling the database from client-application “normal”, indirect call, e.g. via direct call to database, webpage or webservice: ODBC:
  4. 4. now: Webservices
  5. 5. Joomla! as a system on its own
  6. 6. connecting Joomla!
  7. 7. connecting Joomla!
  8. 8. connecting Joomla! to: • desktop applications (RIAs), Java, Flex, Delphi, VS, Titanium, MS Office, etc. • other webapplications: as a server or client • browser: Ajax, Flash • any other computer program...
  9. 9. Example uses: •connecting to multiple Joomla!- sites for backup and upgrading. (e.g.: Akeeba Remote) •using external services (e.g. Google Docs, Amazon S3, etc.) •bridges with other applications (e.g. MageBridge)
  10. 10. Protocols: •your own... •a binary protocol like AMF •using some XML or JSON (Ajax) •one way XML: feed (Atom/RSS) •XML-RPC } when we talk about webservices •SOAP we mostly talk about •REST those 3 ways
  11. 11. Remote Procedure Calls (XML-RPC and SOAP) •call a method on the server •DO something (procedure, verb) vs REST •get/put/post/delete a resource on the server •resource (object, noun)
  12. 12. XML-RPC •define I/O types •phpxmlrpc-library •in Joomla!: as a plugin... •better: use MVC •changed in J! 1.6
  13. 13. Webservice and MVC •model: is the “heart” of application (use same model for webservice) •controller decides what to do based on the input •view: renders the output
  14. 14. XML-RPC in Joomla! 1.6 •no plugin anymore •new JController (might use a strategy pattern?) •controllername.xmlrpc.php •idem: controllername.json.php •index.php?....&protocol=xmlrpc •http://docs.joomla.org/Xml-rpc
  15. 15. SOAP •evolved from XML-RPC •heavily used in .NET •meta-data: WSDL and SOAP-envellope •SOAP-header: a.o. for authentication •WSDL: description in XML-format
  16. 16. SOAP-envellope:
  17. 17. WSDL: •description of a webservice •automatic code generation! •easy to use in e.g. Delphi, Flex, etc.
  18. 18. sample SOAP-calls and WSDL
  19. 19. importing WSDL in Delphi 2010:
  20. 20. importing WSDL in Flex Builder 3:
  21. 21. SOAP in Joomla!, some possibilities: •JMSOAP and com_connector: J!1.0 (vBulletin-connection) •VM SOA: SOAP for VirtueMart •other PHP libraries and Frameworks: NuSoap, PearSoap, Zend, PHP5 SOAP module... $server = new soap_server; require_once(“nusoap.php”); •JSOAP coming soon! (based on PHP5-SOAP)
  22. 22. REST •“representational state transfer” •architecture, not a protocol •linking to recourses, not methods •resource = object + URI •stateless communication •uniform interface (CRUD) •using HTTP-headers and methods
  23. 23. REST in Nooku Framework: •KControllerBread + KRequest works out of the box! •authentication and http status messa- ges not yet 100% (planned for 0.9) Joomla! RESTful thoughts: •www.alltogetherasawhole.org/profiles/ blogs/restful-api-for-joomla
  24. 24. Authentication/Authorization •with XML/RPC credentials are para- meters in the remote procedure call. •with SOAP credentials are in the SOAP-header. •with REST the credentials are in HTTP-headers.
  25. 25. SSL or other encrypting •SSL (https://) can be used to encrypt the credentials (and data) •or you can define encryption of cre- dentials (and data) yourself: - basic (base64: no real encryption) - digest - WSSE, OAuth, your own variation
  26. 26. Get Joomla! connected •providing standard, easy to use con- nections is essential for further deve- lopment of Joomla! •let’s provide XML/RPC, SOAP and REST within the MVC framework in a uniform way (Zend has it all, why not we too?)
  27. 27. let’s connect Joomla!
  28. 28. let’s connect Joomla!
  29. 29. Questions? Contact info: Herman Peeren herman@yepr.nl
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×