Scusate sono poco pratico con gli oggetti...
Da output come questo come si memorizza su variabili il valore?
(tipo echo $Symbol; dovrebbe restituire USDPKR)
codice:
stdClass Object
(
[GetRealTimeCrossRateResult] => stdClass Object
(
[Outcome] => Success
[Message] => Cross-rate calculated by converting to EUR.
[Identity] => Header
[Delay] => 0.009
[Symbol] => USDPKR
[Type] => RealTime
[From] => stdClass Object
(
[Symbol] => USD
[Name] => United States Dollar
)
[To] => stdClass Object
(
[Symbol] => PKR
[Name] => Rupee
)
[Date] => 12/9/2010
[Time] => 11:45:49 AM
[Rate] => 85.8019093105
[Bid] => 85.6712937893
[BidTime] => 11:45:49 AM
[Ask] => 85.9325426138
[AskTime] => 11:45:49 AM
[Text] => 1 United States Dollar = 85.80191 Rupee
)
)
Tale output è ottenuto con delle chiamate Soap tipo queste:
Codice PHP:
$xignite_header = new SoapHeader('http://www.xignite.com/services/','Header', array("Username" => "nome","Password" => "password", "Tracer" => ""));
$wsdl = new soapclient('http://www.xignite.com/xCurrencies.asmx?WSDL');
// attach SOAP header
$wsdl->__setSoapHeaders(array($xignite_header));
// call the service: pass the parameters and name of the operation
$input_params = array('From' => "USD", 'To' => "PKR");
$result = $wsdl->GetRealTimeCrossRate($input_params);
// assess the results
if (is_soap_fault($result)) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}