|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-22 17:50 UTC] vbrodsky at tremormedia dot com
Description: ------------ I am trying to access Akamai Cache Control Service using SOAP Client. Since Akamai officially does not support PHP, I am using Java wsdl https://ccuapi.akamai.com/ccuapi-axis.wsdl. I have created various tests, but no matter what I do I get PHP SOAP exception (see below). Is there is something wrong with the array of strings passed as a parameter? There apparently used to be idoox interoperatbility issue with an array of strings (http://aspn.activestate.com/ASPN/Mail/Message/soapbuilders/761488) but it is fixed, supposedly. BTW my php version is 1.5.6 (comes CentOS distribution) Reproduce code: --------------- echo "******************************<BR>"; echo "Example1: call using array() to pass ArrayOfString"; $client = new SoapClient("https://ccuapi.akamai.com/ccuapi-axis.wsdl"); var_dump($client->__getFunctions()); var_dump($client->__getTypes()); $params = array('xxx', 'yyy', NULL, NULL, "http://objects.dev.tremormedia.com/xml/val.xml"); try { $purgeResult = $client->purgeRequest($params); } catch(SoapFault $e){ echo "Exception <BR>"; var_dump($e); echo "<BR>"; } var_dump($purgeResult); echo "******************************<BR>"; echo "Example7: call using associative array() to pass parameters; ArrayOfString is passed as php array()" . "<BR>"; $client = new SoapClient("https://ccuapi.akamai.com/ccuapi-axis.wsdl"); var_dump($client->__getFunctions()); var_dump($client->__getTypes()); $params = array( "name" => "xxx", "pwd" => "yyy", "network" => array(''), "opt" => array("action=remove"), "uri"=> array("http://objects.dev.tremormedia.com/xml/val.xml") ); try { $purgeResult = $client->purgeRequest($params); } catch(SoapFault $e){ echo "Exception <BR>"; var_dump($e); echo "<BR>"; } var_dump($purgeResult); Expected result: ---------------- should return something... perhaps an Akamai error (url does not existetc.). Should not cause a php exception Actual result: -------------- object(SoapFault)[2] protected 'message' => string 'Exception: class com.idoox.soap.DemarshallException: Type in schema differs from type in SOAP message - expected string@http://www.w3.org/1999/XMLSchema; got ArrayOfString@http://www.akamai.com/purge' (length=199) private 'string' => string '' (length=0) protected 'code' => int 0 protected 'file' => string '/var/www/html/ais2/service/akamaisoap/test.php' (length=46) protected 'line' => int 13 private 'trace' => array 0 => array 'function' => string '__call' (length=6) 'class' => string 'SoapClient' (length=10) 'type' => string '->' (length=2) 'args' => array ... 1 => array 'file' => string '/var/www/html/ais2/service/akamaisoap/test.php' (length=46) 'line' => int 13 'function' => string 'purgeRequest' (length=12) 'class' => string 'SoapClient' (length=10) 'type' => string '->' (length=2) 'args' => array ... public 'faultstring' => string 'Exception: class com.idoox.soap.DemarshallException: Type in schema differs from type in SOAP message - expected string@http://www.w3.org/1999/XMLSchema; got ArrayOfString@http://www.akamai.com/purge' (length=199) public 'faultcode' => string 'SOAP-ENV:Server' (length=15) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
This works for me: <?php $client = new SoapClient('https://ccuapi.akamai.com/ccuapi-axis.wsdl'); $username = 'example'; $password = 'secret'; $url = 'http://www.example.com/foo.php'; try { $purgeResult = $client->purgeRequest($username, $password, '', array(), array($url)); } catch(SoapFault $e){ echo "Exception\n"; var_dump($e); echo "\n"; } var_dump($purgeResult); ?>