WebServices in PHP

So, you’ve to consume webservices integrating all this in a simple php app. There’re tonns of docs but you don’t know where to start. So, let’s start!

 

A WS is an application accessible on the web thru given rules (ex. a simple WS can perform the sum of two number).

 

To use a WS you need to know how to use it, which parameters take on input, and what returns. The WSDL of the application contains this information.

 

More info on Creating And Consuming Web Services In Php 5

 

Now let’s stumble upon some code. To use a webservice (aka consume it) we can use SoapClient php class, described in http://it.php.net/soap

 
// create a new soapclient  object
$wsdl = "http://localhost/myservice/wsdl";
$wsapi = new SoapClient($wsdl, array("admin", "password"));

 

SoapClient loads the WSDL (it’s an xml file) thus learning

  • the list of methods
  • the url of each method
  • the signature of each method (params in, params out)

 

It eventually authenticates agains webservices with “login” and “password”.

 

If the WSDL contains the following information:

  • method: add(a,b)
    • url: http://localhost/myservice/add
    • params: a: integer, b: integer
    • return: x: integer

then we can invoke directly from php (withouth further definitions):

 
// now it's all defined! the wsdl did all the job
$sum = $wsapi->add("1","3");
echo "$sum";

 

Enjoy!

Continue reading “WebServices in PHP”

Gfxboot con GRUB (SuSE-like)

Visto che a molti non piace avere il classico grub (bianco su nero), e l’idea di avere un’immagine di sfondo limitata ad una manciata di colori non è proponibile, ho cercato il modo per avere un grub simile a quello di (Open)SuSE: animazioni (o solo anche immagini migliori) per la scelta del S.O.

by Enrico Bassetti – http://www.enricobassetti.altervista.org/guide/gfxgrub.php

Indice:

  1. Iniziare: materiale occorrente
  2. Installazione
  3. Personalizzazione del tema
  4. Temi già pronti e crediti

Continue reading “Gfxboot con GRUB (SuSE-like)”

Creare un mirror locale – Debian & derivati

In questo (mini)-howto descriverò “come fare” per creare un mirror locale dopo una breve riflessione sull’effettiva convenienza.

by Enrico Bassetti – http://www.enricobassetti.altervista.org/guide/apt-mirror.php

Indice:

  1. Prerequisiti
  2. Mirror locale: vantaggi e svantaggi
  3. Lista repository

Continue reading “Creare un mirror locale – Debian & derivati”