JNettles Posted August 7, 2009 Share Posted August 7, 2009 I have .NET web service that I'm accessing through PHP. This web service is passed an ID and returns four properties from my DB2 server to the PHP object - code is as follows. $client = new soapclient(SOAP_ADDRESS); $objectresult = $client->GetDataByID(array('PeopleVendorsID'=> 'N21248')); GetDataByID is my .NET web service function. PeopleVendorsID is the parameter that I passed it, a person's unique ID at our organization. SOAP_ADDRESS is a constant with my WSDL address - all of this is fine. PHP is hitting the database and returning data to $objectresult because when I do a var_dump I get this in the browser: array(1) { ["GetDataByIDResult"]=> object(stdClass)#3 (1) { ["PEOPLE_VENDORSObject"]=> object(stdClass)#4 (4) { ["PEOPLE_VENDORS_ID"]=> string(10) "N21248 " ["FIRST_NAME"]=> string( "Kimberly" ["LAST_NAME"]=> string(6) "Kurrus" ["DATE_OF_BIRTH"]=> string(19) "1958-01-28T00:00:00" } } } Its grabbing all the correct data and when I do a var_dump I can see everything in the object, but when I try to access the individual properties I get nothing. I even tried translating it into an array but didn't get anything that way either. print $objectresult->FIRST_NAME; $objectresult obviously has all of the data inside of it but for some reason I'm blocked from calling the results out of the object? I also tried assigning $objectresult to a new property and that didn't work either. Can anybody help me in what I'm missing here? Be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/169276-accessing-soap-object-properties/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.