In this exercise you must consume a SOAP webservice using SoapClient(...)
Try some of the functions from the Football SOAP service from the browser http://footballpool.dataaccess.eu/data/info.wso
And learn some SOAP. This will be useful when you later call the functions from PHP.
Make the example https://www.vankouteren.eu/blog/simple-php-soap-example/ work on your computer.
Do not spend (much) time trying to read the WSDL file.
Try to show a list of 1 players.
Show the response called $array
in the example.
The PHP function print_r(...)
might be handy.
The response includes a reference to the players contry flag.
Add another column to the output table: The flag for each player.
Hint: HTML images
Show a list of stadium names
$result = $client -> StadiumNames();
Use print_r($result)
to observe the structure of the result.
How to get into (using ->
) the $result
to get the stadium names array.
Iterate the array using a foreach
loop.
We want more information about each stadium - not just the names.
These lines can give you more information
$resultDetail = $client->StadiumInfo(array('sStadiumName' => $name)); $details = $resultDetail->StadiumInfoResult;
Show the information similar to this
Show information about teams: Name, flag, etc.
$client = new SoapClient("http://footballpool.dataaccess.eu/data/info.wso?wsdl");
$result = $client->Teams();