SoapFault-exception using Zend Soap Client & Webservice

1 message Options
Embed this post
Permalink
Marcus Stöhr

SoapFault-exception using Zend Soap Client & Webservice

Reply Threaded More More options
Print post
Permalink
Hi,

since the weekend I try to get Zend Soap Client running with the Webservice provided by affili.net.

Everytime I try to run the method 'SearchProducts', I get the following exception:

[16-Sep-2009 12:22:47] PHP Fatal error:  Uncaught SoapFault exception: [HTTP] Cannot process the message because the content type 'application/soap+xml; charset=utf-8; action="http://affilinet.framework.webservices/Svc/ProductServiceContract/SearchProducts"' was not the expected type 'text/xml; charset=utf-8'. in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php:937
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://api.aff...', 'http://affiline...', 2)
#1 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php(937): call_user_func(Array, '<?xml version="...', 'https://api.aff...', 'http://affiline...', 2)
#2 [internal function]: Zend_Soap_Client->_doRequest(Object(Zend_Soap_Client_Common), '<?xml version="...', 'https://api.aff...', 'http://affiline...', 2, 0)
#3 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client/Common.php(70): call_user_func(Array, Object(Zend_Soap_Client_Common), '<?xml version="...', 'https://api.aff...', 'http://affiline...', 2, 0)
#4 [internal function in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php on line 937

I there a way to prevent this exception? My sample code looks like this:

<?php
$options = array(
                        'login' => 'MyUser',
                        'password' => 'MyPassword');
$parameters = array(
                        'ShopIds' => array('3752'),
                        'Query' => 'foo bar',
                'WithImageOnly' => true,
                'Details' => 'true',
                'ImageSize' => 'AllImages',
                'CurrentPage' => '1',
                'PageSize' => '10',
                'MinimumPrice' => '0',
                'MaximumPrice' => '0',
                'SortBy' => 'Rank',
                'SortOrder' => 'Descending');

$client = new Zend_Soap_Client('https://api.affili.net/V2.0/ProductServices.svc?wsdl', $options);
       
Zend_Debug::dump($client->SearchProducts($parameters));

?>

I already filled a bug report for this issue: http://framework.zend.com/issues/browse/ZF-7865

- Marcus