ZF-10754: Missing attribute name in fault type declaration in generated WSDL
Description
When we try to set a new fault return type in wsdl listed method with Zend_Soap_Wsdl, it failed to add name attribute.
When trying to use addPortOperation with fault argument, it doesn't add the name attribute. SoapUI failed to load wsdl without name attribute here.
Possible fix:
if (is_string($fault) && (strlen(trim($fault)) >= 1)) {
$node = $this->_dom->createElement('fault');
$node->setAttribute('message', $fault);
//remove tns:
$node->setAttribute('name', substr(strchr($fault, ':'), 1));
$operation->appendChild($node);
}
Existing code:
if (is_string($fault) && (strlen(trim($fault)) >= 1)) {
$node = $this->_dom->createElement('fault');
$node->setAttribute('message', $fault);
$operation->appendChild($node);
}
Comments
Posted by Jeannie BOFFEL (jboffel) on 2011-05-04T21:43:01.000+0000
Warning patch including fix for ZF-10755 !
Posted by Jeannie BOFFEL (jboffel) on 2011-05-04T21:44:23.000+0000
Warning test suite file patch include test for ZF-10755
Posted by Ralph Schindler (ralph) on 2011-05-05T20:00:45.000+0000
Patches look good, please provide screenshot of failed validation in soap ui. Ill then commit it.
Posted by Jeannie BOFFEL (jboffel) on 2011-05-06T09:11:03.000+0000
For this one, it's a little more complicate to show effect. In fact, it is not exactly a WSDL standard problem. SOAP UI can load the WSDL without mistake. However, the SoapServer extension of PHP is making trouble here. If it does not find the name attribute, it will return empty answer at any request to the webservice. So in fact, SoapServer extension could be changed to be less strict and not ask for the missing name attribute to do the job, or we can patch Zend Framework to handle SoapServer behavior of PHP. I recommend patch Zend Framework...
Here a log of SOAP UI before and after the fix :