php - CakePHP SoapClient drops fields? -
my app uses cakephp (2.2.5) data soap server. put logging soapsource.php connector see xml returned , display array returned:
$result = $this->client->__soapcall($method, array('parameters' => $tparams)); logger::write('soap last response', $this->client->__getlastresponse(), 3, 'transaction'); logger::write('soap last response object', print_r($result, true), 3, 'transaction');
but i'm seeing in log 2 (recently-added) fields present in xml missing array, specifically, last 2 before rplist (formatted here otherwise verbatim):
<transactionresult> <id>test</id> <resultcode>0</resultcode> <readscheduledrecordingsrsp> <recordingdefinitionlist> <recordingdefinition> <rdid>d8c16d8f-67c6-469a-83c3-d51d8f8859a9</rdid> <title>the young , restless</title> <seriesid>4422</seriesid> <keepuntil>spaceisneeded</keepuntil> <startpadseconds>0</startpadseconds> <endpadseconds>0</endpadseconds> <frequency>everyday</frequency> <keepatmost>0</keepatmost> <priority>23</priority> <showtype>any</showtype> <airtimedomain>specifictime</airtimedomain> <channeldomain>specificchannel</channeldomain> <rplist> ...
followed by:
array ( [transactionresult] => stdclass object ( [id] => test [resultcode] => 0 [readscheduledrecordingsrsp] => stdclass object ( [recordingdefinitionlist] => stdclass object ( [recordingdefinition] => array ( [0] => stdclass object ( [rdid] => d8c16d8f-67c6-469a-83c3-d51d8f8859a9 [title] => young , restless [seriesid] => 4422 [keepuntil] => spaceisneeded [startpadseconds] => 0 [endpadseconds] => 0 [frequency] => everyday [keepatmost] => 0 [priority] => 23 [showtype] => [rplist] => stdclass object ( ...
i'm guessing forgot or didn't know something, don't know what. it's suspicious 2 fields don't work 2 added, can't find place fields enumerated.
the wsdl doesn't specify fields @ all, there bunch of data inside transactionresult.
in connect call, options likewise don't specify fields.
it worked fine until back-end added 2 fields, , still works fine, except can't see 2 new fields in object.
any ideas?
it nice see xml rplist. version of php/libxml?
have validated xml returned __getlastresponse()?
it sounds me using wsdl mode client wsdl file lacks precision. try using wsdl describes data being served api.
am understanding $result object when dumped lists rplist
value not expect? if might able away adding soap_single_element_arrays
option clients constructor: new soapclient($wsdl, array('features' => soap_single_element_arrays));
. that's long shot though. need see wsdl , full output __getlastresponse()
.
any errors? try wrapping call so:
try { $client = new soapclient ('http://yoursite.com?wsdl', array("trace" => 1, "exceptions" => true, "cache_wsdl" => wsdl_cache_none, "features" => soap_single_element_arrays) ); $result = $client->somemethod($data); } catch (soapfault $exception) { var_dump($exception); } catch (exception $exception) { var_dump($exception); }
short of fixing wsdl/xml response workaround seems best solution.
Comments
Post a Comment