ZF-9285: 'Operation '' is not defined in the WSDL' Error in Zend_Soap_Client
Description
Zend_Soap_Client has a bug in it that causes the following error to be thrown when calling a method on the soap object:
{quote} Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Operation '' is not defined in the WSDL for this service in /var/www/site/library/Zend/Soap/Client.php:1113 Stack trace: #0 /var/www/site/library/Zend/Soap/Client.php(1113): SoapClient->__soapCall('NDFDgen', Array, NULL, NULL, Array) #1 [internal function]: Zend_Soap_Client->__call('NDFDgen', Array) #2 /var/www/site/public/test.php(156): Zend_Soap_Client->NDFDgen(39, -77, 'time-series', '2010-02-27T12:0...', '2010-02-28T12:0...', Array) #3 {main} thrown in /var/www/site/library/Zend/Soap/Client.php on line 1113 {quote}
If I bypass Zend_Soap_Client and use SoapClient, passing the exact same parameters and then calling the exact same method name, it WORKS.
Code that FAILS (with or without compression being set in options):
$soap = new Zend_Soap_Client('http://weather.gov/forecasts/xml/…', array());
$soap->NDFDgen(39.0000, -77.0000, 'time-series', '2010-02-27T12:00', '2010-02-28T12:00', array(
'maxt' => 1,
'mint' => 1,
'temp' => 1,
'dew' => 1,
'appt' => 1,
'pop12' => 1,
'qpf' => 1,
'snow' => 1,
'sky' => 1,
'rh' => 1,
'wspd' => 1,
'wdir' => 1,
'wx' => 1,
'icons' => 1,
'waveh' => 1,
'incw34' => 1,
'incw50' => 1,
'incw64' => 1,
'cumw34' => 1,
'cumw50' => 1,
'cumw64' => 1,
'wgust' => 1,
'conhazo' => 1,
'ptornado' => 1,
'pxtornado' => 1,
'phail' => 1,
'pxhail' => 1,
'tstmprb' => 1,
'tstmcat' => 1,
'pxtstmwinds' => 1,
'ptstmwinds' => 1,
'ptotsvrtstm' => 1,
'pxtotsvrtstm' => 1,
'tmpabv14d' => 0,
'tmpblw14d' => 0,
'tmpabv30d' => 0,
'tmpblw30d' => 0,
'tmpabv90d' => 0,
'tmpblw90d' => 0,
'prcpabv14d' => 0,
'prcpblw14d' => 0,
'prcpabv30d' => 0,
'prcpblw30d' => 0,
'prcpabv90d' => 0,
'prcpblw90d' => 0,
'precipa_r' => 1,
'sky_r' => 1,
'td_r' => 1,
'temp_r' => 1,
'wdir_r' => 1,
'wwa' => 1,
'wspd_r' => 1
));
Code that WORKS (Substitute Zend_Soap_Client for SoapClient):
$soap = new SoapClient('http://weather.gov/forecasts/xml/…');
$result = $soap->NDFDgen(39.0000, -77.0000, 'time-series', '2010-02-27T12:00', '2010-02-28T12:00', array(
'maxt' => 1,
'mint' => 1,
'temp' => 1,
'dew' => 1,
'appt' => 1,
'pop12' => 1,
'qpf' => 1,
'snow' => 1,
'sky' => 1,
'rh' => 1,
'wspd' => 1,
'wdir' => 1,
'wx' => 1,
'icons' => 1,
'waveh' => 1,
'incw34' => 1,
'incw50' => 1,
'incw64' => 1,
'cumw34' => 1,
'cumw50' => 1,
'cumw64' => 1,
'wgust' => 1,
'conhazo' => 1,
'ptornado' => 1,
'pxtornado' => 1,
'phail' => 1,
'pxhail' => 1,
'tstmprb' => 1,
'tstmcat' => 1,
'pxtstmwinds' => 1,
'ptstmwinds' => 1,
'ptotsvrtstm' => 1,
'pxtotsvrtstm' => 1,
'tmpabv14d' => 0,
'tmpblw14d' => 0,
'tmpabv30d' => 0,
'tmpblw30d' => 0,
'tmpabv90d' => 0,
'tmpblw90d' => 0,
'prcpabv14d' => 0,
'prcpblw14d' => 0,
'prcpabv30d' => 0,
'prcpblw30d' => 0,
'prcpabv90d' => 0,
'prcpblw90d' => 0,
'precipa_r' => 1,
'sky_r' => 1,
'td_r' => 1,
'temp_r' => 1,
'wdir_r' => 1,
'wwa' => 1,
'wspd_r' => 1
)
);
Comments
Posted by Jan Pieper (jpieper) on 2010-07-05T12:08:23.000+0000
The server is unable to handle SOAP 1.2 requests. Zend_Soap_Client is using 1.2 as default SOAP version, SoapClient uses 1.1. You need to switch your client's SOAP version to 1.1.
```