SOAPに関しては私は無知です。soap result to variable、PHP
<?php
// define the SOAP client using the url for the service
$client = new soapclient('http://www.xignite.com/xMetals.asmx?WSDL', array('trace' => 1));
// create an array of parameters
$param = array(
'Type' => "XAU",
'Currency' => "USD");
// call the service, passing the parameters and the name of the operation
$result = $client->GetLastRealTimeMetalQuote($param);
// 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>';
}
?>
と私は私が手にスクリプトを実行します:
Result
stdClass Object
(
[GetLastRealTimeMetalQuoteResult] => stdClass Object
(
[Outcome] => Success
[Identity] => IP
[Delay] => 0.006
[Symbol] => XAUUSDO
[Type] => XAU
[Currency] => USD
[Date] => 8/1/2011
[Time] => 11:18:48 PM
[Rate] => 1618.88500977
[Bid] => 1618.55004883
[BidTime] => 11:18:48 PM
[Ask] => 1619.2199707
[AskTime] => 11:18:48 PM
)
)
私は結果の残りの部分から[入札]を析出し、それを保存するにはどうすればよいの私は、Webサービス呼び出しを行っております変数。
それでも、配列を引き出すにはどうすればよいですか?
ARRAYではなくOBJECTを返すことに注意してください。私はこれらがすべて混ざり合っていることに気づいた。最初のケースでは単一のオブジェクトが返されますが、2番目のケースでは複数のオブジェクトが返されると悪化します。あなたはそれぞれの状況に応じて別々のルーチンが必要です。 –