PHP SOAP致命错误消息


PHP SOAP fatal error message

我的web服务器已经正确安装了SOAP (phpinfo有SOAP Client/Server - Enabled)。

我正在尝试创建一个对远程magento存储的SOAP请求,并且我得到这个错误消息:

[Mon Aug 29 20:13:59 2011] [error] [client 79.178.13.67] PHP Fatal error:  Uncaught SoapFault exception: [0] Unable to load Soap extension on the server in /home/example/public_html/mag/index.php:3
Stack trace:
#0 [internal function]: SoapClient->__call('login', Array)
#1 /home/example/public_html/mag/index.php(3): SoapClient->login('user', 'pass')
#2 {main}'n  thrown in /home/example/public_html/mag/index.php on line 3

代码片段:

$client = new SoapClient('http://www.example.com/api/soap/?wsdl=1');
$session = $client->login('user','pass');
$attributeSets = $client->call($session,'product_attribute_set.list');
$set = current($attributeSets);
$sku = 'iphone-12345';
$imagePath="../image.jpg";
$newProductData = array(
'name'              => 'iPhone',
'websites'          => array(1),
'short_description' => 'short description',
'description'       => 'description',
'price'             => 150,
'status'            => '1',
);
$newImage = array(
'file' => array(
'name' => 'file_name',
'content' => base64_encode(file_get_contents($imagePath)),
'mime'    => 'image/jpeg'
),
'label'    => 'Cool Image',
'position' => 0,
'types'    => array('image','small_image','thumbnail'),
'exclude'  => 0
);
$imageFilename = $client->call($sessionId, 'product_media.create', array($sku,$newImage));
$productId = $client->call($session,'product.create',array('simple', $set['set_id'],$sku,$newProductData));
echo $productId;

任何想法?

谢谢,

尝试更新WSDL的服务器端(运行SoapServer的地方)

更新:

    PHP
  • PHP-SOAP

和依赖项;-)

可能是服务器端PHP(和/或soap)的过时版本

相关文章: