<?php $soapClient = new SoapClient("http://localhost:9080/" . "ItsoWebService2RouterWeb/wsdl/itso/session/WeatherForecastEJB.wsdl"); ?> |
$functions = $soapClient->__getFunctions(); print_r($functions); $types = $soapClient->__getTypes(); print_r($types); |
getForecastResponse getForecast(getForecast $parameters) struct getForecast { dateTime startDate; int days; } struct getForecastResponse { Weather getForecastReturn; } struct Weather { string condition; dateTime date; string windDirection; int windSpeed; int temperatureCelsius; boolean dbflag; } |
$getForecastParam = array(@#startDate@# =>time(), @#days@# => 3); |
$forecastResponse = $soapClient->getForecast($getForecastParam); |
echo "<table border=1 cellpadding=5>"; echo "<tr><th>Date</th><th>Condition</th><th>Temperature</th><th>Wind</th></tr>"; $weatherArray = $forecastResponse->getForecastReturn; foreach ($weatherArray as $weather) { echo "<tr>", "<td>",strftime("%a. %b %d, %Y", strtotime($weather->date)),"</td>", "<td>$weather->condition</td>", "<td>$weather->temperatureCelsius</td>", "<td>$weather->windDirection $weather->windSpeed</td>", "</tr>"; } echo "</table>"; |
|