note 92828 modified in soapclient.soapcall by danbrown

From: Date: Tue, 11 Aug 2009 15:22:35 +0000
Subject: note 92828 modified in soapclient.soapcall by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159332@lists.php.net to get a copy of this message
When dealing with .NET web services, its a good to remember that moving data back and forth between PHP and .NET can be a little cumbersome if you aren't familiar with the object structures of both. .NET will return everything inside of an object - usually your function name with "Result" tagged onto the end. Example. <?php $client = new soapclient(SOAP_ADDRESS); $objectresult = $client->GetDataByID(array('PeopleVendorsID'=> 'N21248')); ?> .... where GetDataByID is my .NET web service function, PeopleVendorsID is name of the parameter I pass it, and "N21248" happens to be the value of the parameter. .NET was supposed to return an array to $objectresult but instead I found myself with a triple-nested object. Basically, if you ever find yourself in a situation where you can't seem to access your data, make use of var_dump. <?php var_dump($objectresult); ?> This will print out a very handy array/object structure for you to sift through - invaluable if you're dealing with cryptic results from .NET. --was-- When dealing with .NET web services, its a good to remember that moving data back and forth between PHP and .NET can be a little cumbersome if you aren't familiar with the object structures of both. .NET will return everything inside of an object - usually your function name with "Result" tagged onto the end. Example. <? $client = new soapclient(SOAP_ADDRESS); $objectresult = $client->GetDataByID(array('PeopleVendorsID'=> 'N21248')); ?> .... where GetDataByID is my .NET web service function, PeopleVendorsID is name of the parameter I pass it, and "N21248" happens to be the value of the parameter. .NET was supposed to return an array to $objectresult but instead I found myself with a triple-nested object. Basically, if you ever find yourself in a situation where you can't seem to access your data, make use of var_dump. <?php var_dump($objectresult); ?> This will print out a very handy array/object structure for you to sift through - invaluable if you're dealing with cryptic results from .NET. http://php.net/manual/en/soapclient.soapcall.php

« previous php.notes (#159332) next »