php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43910 Error when parsing Akamain SOAP
Submitted: 2008-01-22 17:50 UTC Modified: 2010-02-26 22:05 UTC
Votes:4
Avg. Score:4.0 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: vbrodsky at tremormedia dot com Assigned:
Status: No Feedback Package: SOAP related
PHP Version: 5.2.5 OS: CentOS release 5 (Final)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vbrodsky at tremormedia dot com
New email:
PHP Version: OS:

 

 [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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:13 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2008-02-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-02-26 22:05 UTC] hradtke@php.net
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);
?>
 [2012-01-23 13:14 UTC] pritiatwork at gmail dot com
PHP : 5.2.11
OS:RedHat5

Error Received:
string(192) "Exception: class com.idoox.soap.DemarshallException: Type in schema differs from type in SOAP message - expected string@http://www.w3.org/1999/XMLSchema; got Map@http://xml.apache.org/xml-soap"
 [2012-01-24 16:49 UTC] pritiatwork at gmail dot com
To resolve this issue one can type cast the parameter.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 15:01:36 2024 UTC