Author Topic: SOAP  (Read 1478 times)

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
SOAP
« on: July 14, 2011, 09:48:06 PM »
How do I get a specific piece of a SOAP response??

Code: [Select]
$result = $client->GetLastClosingPrice($param);
// assess the results
if (is_soap_fault($result)) {
     echo '<h2>Fault</h2><pre>';
     print_r($result);
     echo '</pre>';
} else {
     
     //echo $result[0]->LastClose;
         
     echo '<h2>Result</h2><pre>';
     
     print_r($result);
     echo '</pre>';
}

Code: [Select]
stdClass Object
(
    [GetLastClosingPriceResult] => stdClass Object
        (
            [Outcome] => Success
            [Identity] => Header
            [Delay] => 0.006
            [Security] => stdClass Object
                (
                    [Outcome] => Success
                    [Delay] => 0
                    [CIK] => 0001341439
                    [Cusip] => 68389X105
                    [Symbol] => ORCL
                    [ISIN] => US68389X1054
                    [Valoren] => 959184
                    [Name] => Oracle Corporation
                    [Market] => NASDAQGS
                    [CategoryOrIndustry] => TECHNOLOGY
                )

            [Date] => 7/14/2011
            [Last] => 32.05
            [Open] => 32.81
            [LastClose] => 32.69
            [High] => 33.1
            [Low] => 31.86
            [ChangeFromOpen] => -0.76
            [PercentChangeFromOpen] => -2.316
            [ChangeFromLastClose] => -0.64
            [PercentChangeFromLastClose] => -1.958
            [Volume] => 32194500
            [SplitRatio] => 1
            [LastAdjusted] => 32.05
            [OpenAdjusted] => 32.81
            [LastCloseAdjusted] => 32.69
            [HighAdjusted] => 33.1
            [LowAdjusted] => 31.86
            [ChangeFromOpenAdjusted] => -0.76
            [ChangeFromLastCloseAdjusted] => -0.64
            [VolumeAdjusted] => 32194500
            [NotTraded] =>
        )

)

I need to get the name.  If you can use print_r to dump it out, it's gotta be an array, right?  But it's like there are multiple objects inside of there.  I'm using PHP5 Native Soap functionality.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: SOAP
« Reply #1 on: July 14, 2011, 10:16:17 PM »
Nevermind, I never knew what the stdClass was before now.

echo $result->GetLastClosingPriceResult->Security->Name;