Re: [PHP-DEV] ext/soap ctor errors
On Mon, Sep 1, 2008 at 16:57, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > After some thoughts I decided to disable warnings. > The fix is committed into HEAD and PHP_5_3. Is that something that should be documented anywhere? NEWS? manual? wiki? blog? twitter? -Hannes p.s. Please stop top-posting. It may safe you a second, but it wastes few seconds from every other person on this list. Don't be that selfish please. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
After some thoughts I decided to disable warnings. The fix is committed into HEAD and PHP_5_3. Thanks. Dmitry. Lukas Kahwe Smith wrote: > > On 01.09.2008, at 11:29, Dmitry Stogov wrote: > >> ext/soap uses php_libxml_switch_context from ext/libxml, however it >> doesn't provide internal equivalent for libxml_use_internal_errors(). >> >> Thanks. Dmitry. >> >> Hannes Magnusson wrote: >>> On Fri, Aug 29, 2008 at 17:08, Dmitry Stogov <[EMAIL PROTECTED]> wrote: Especially for this situation warnings are generated by libxml. I don't like to disable these warnings in ext/soap, because in some situation libxml may generate warnings and then return parsed document. So SoapClient() won't generate exception, but all warnings would be lost. >>> >>> Hmmmh. So ext/soap does not use ext/libxml and therefore ignores my >>> libxml_set_stream_context() and libxml_use_internal_errors() >>> preferences? >>> > > > Seems like something that would be nice to have fixed someday. Should > this be logged as a feature request? > > regards, > Lukas Kahwe Smith > [EMAIL PROTECTED] > > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
On 01.09.2008, at 11:29, Dmitry Stogov wrote: ext/soap uses php_libxml_switch_context from ext/libxml, however it doesn't provide internal equivalent for libxml_use_internal_errors(). Thanks. Dmitry. Hannes Magnusson wrote: On Fri, Aug 29, 2008 at 17:08, Dmitry Stogov <[EMAIL PROTECTED]> wrote: Especially for this situation warnings are generated by libxml. I don't like to disable these warnings in ext/soap, because in some situation libxml may generate warnings and then return parsed document. So SoapClient() won't generate exception, but all warnings would be lost. Hmmmh. So ext/soap does not use ext/libxml and therefore ignores my libxml_set_stream_context() and libxml_use_internal_errors() preferences? Seems like something that would be nice to have fixed someday. Should this be logged as a feature request? regards, Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
ext/soap uses php_libxml_switch_context from ext/libxml, however it doesn't provide internal equivalent for libxml_use_internal_errors(). Thanks. Dmitry. Hannes Magnusson wrote: > On Fri, Aug 29, 2008 at 17:08, Dmitry Stogov <[EMAIL PROTECTED]> wrote: >> Especially for this situation warnings are generated by libxml. >> I don't like to disable these warnings in ext/soap, because in some >> situation libxml may generate warnings and then return parsed document. >> So SoapClient() won't generate exception, but all warnings would be lost. > > Hmmmh. So ext/soap does not use ext/libxml and therefore ignores my > libxml_set_stream_context() and libxml_use_internal_errors() > preferences? > > -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
On Fri, Aug 29, 2008 at 17:08, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > Especially for this situation warnings are generated by libxml. > I don't like to disable these warnings in ext/soap, because in some > situation libxml may generate warnings and then return parsed document. > So SoapClient() won't generate exception, but all warnings would be lost. Hmmmh. So ext/soap does not use ext/libxml and therefore ignores my libxml_set_stream_context() and libxml_use_internal_errors() preferences? -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
Especially for this situation warnings are generated by libxml. I don't like to disable these warnings in ext/soap, because in some situation libxml may generate warnings and then return parsed document. So SoapClient() won't generate exception, but all warnings would be lost. Thanks. Dmitry. Lukas Kahwe Smith wrote: > > On 13.08.2008, at 14:31, David Zülke wrote: > >> True, it indeed does since 5.3... but what about that warning; does it >> have to be raised at all? if the "exceptions" option is passed? >> >> Am 08.08.2008 um 09:39 schrieb Dmitry Stogov: >> >>> Hi, >>> >>> I took a quick look into the issue and I didn't found a problem. >>> SoapClient constructor already throws exceptions in case of WSDL errors. >>> >>> >> try { >>> new SoapClient("non-existent"); >>> } catch (Exception $e) { >>> echo "CATCHED: ".$e->getMessage()."\n"; >>> } >>> >>> Warning: SoapClient::SoapClient(): I/O warning : failed to load >>> external entity "non-existent" in Command line code on line 1 >>> CATCHED: SOAP-ERROR: Parsing WSDL: Couldn't load from 'non-existent' >>> : failed to load external entity "non-existent" >>> >>> SoapServer does fatal errors, but it souldn't be a problem, because >>> servers use their own WSDL files which may be fixed. >>> >>> Thanks. Dmitry. >>> >>> >>> Lukas Kahwe Smith wrote: On 24.07.2008, at 14:36, Noah Fontes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi Dmitry, > > SOAP generally uses php_error[_docref] everywhere for errors that are > not actual SOAP faults, even in exceptions mode. Is this intentional, > and would it be worth the BC break to change all of the php_errors to > exceptions? > > Most of the SOAP SDL-loading php_errors are also E_ERROR, for > reasons I > don't really understand. If we don't move to exceptions, can we at > least > reduce the severity for some of these to E_WARNING? > > e.g. (php_sdl.c:824): > > if (op_name == NULL) { > soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for > "); > } By when do you guys think you can complete the changes? regards, Lukas Kahwe Smith [EMAIL PROTECTED] >>> >> > > > Maybe a general question (not sure if its in time to address this stuff > for 5.3.0). > > We are getting more and more extensions with an "exception mode". I > guess PDO is the rolemodel here and in absence of a discussion about > this it seems like we have accepted this sort of behavior. But what I > wonder is if such "exception modes" should mean that if an exception is > thrown for a specific issue, if this should then disable > warnings/notices/errors that would be raised for the same issue. > > regards, > Lukas Kahwe Smith > [EMAIL PROTECTED] > > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
Am 29.08.2008 um 13:11 schrieb Lukas Kahwe Smith: On 13.08.2008, at 14:31, David Zülke wrote: Am 08.08.2008 um 09:39 schrieb Dmitry Stogov: Hi, I took a quick look into the issue and I didn't found a problem. SoapClient constructor already throws exceptions in case of WSDL errors. getMessage()."\n"; } Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "non-existent" in Command line code on line 1 CATCHED: SOAP-ERROR: Parsing WSDL: Couldn't load from 'non- existent' : failed to load external entity "non-existent" SoapServer does fatal errors, but it souldn't be a problem, because servers use their own WSDL files which may be fixed. Thanks. Dmitry. True, it indeed does since 5.3... but what about that warning; does it have to be raised at all? if the "exceptions" option is passed? Maybe a general question (not sure if its in time to address this stuff for 5.3.0). We are getting more and more extensions with an "exception mode". I guess PDO is the rolemodel here and in absence of a discussion about this it seems like we have accepted this sort of behavior. But what I wonder is if such "exception modes" should mean that if an exception is thrown for a specific issue, if this should then disable warnings/notices/errors that would be raised for the same issue. Yes, it should IMO. David smime.p7s Description: S/MIME cryptographic signature
Re: [PHP-DEV] ext/soap ctor errors
On 13.08.2008, at 14:31, David Zülke wrote: True, it indeed does since 5.3... but what about that warning; does it have to be raised at all? if the "exceptions" option is passed? Am 08.08.2008 um 09:39 schrieb Dmitry Stogov: Hi, I took a quick look into the issue and I didn't found a problem. SoapClient constructor already throws exceptions in case of WSDL errors. getMessage()."\n"; } Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "non-existent" in Command line code on line 1 CATCHED: SOAP-ERROR: Parsing WSDL: Couldn't load from 'non- existent' : failed to load external entity "non-existent" SoapServer does fatal errors, but it souldn't be a problem, because servers use their own WSDL files which may be fixed. Thanks. Dmitry. Lukas Kahwe Smith wrote: On 24.07.2008, at 14:36, Noah Fontes wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Dmitry, SOAP generally uses php_error[_docref] everywhere for errors that are not actual SOAP faults, even in exceptions mode. Is this intentional, and would it be worth the BC break to change all of the php_errors to exceptions? Most of the SOAP SDL-loading php_errors are also E_ERROR, for reasons I don't really understand. If we don't move to exceptions, can we at least reduce the severity for some of these to E_WARNING? e.g. (php_sdl.c:824): if (op_name == NULL) { soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for "); } By when do you guys think you can complete the changes? regards, Lukas Kahwe Smith [EMAIL PROTECTED] Maybe a general question (not sure if its in time to address this stuff for 5.3.0). We are getting more and more extensions with an "exception mode". I guess PDO is the rolemodel here and in absence of a discussion about this it seems like we have accepted this sort of behavior. But what I wonder is if such "exception modes" should mean that if an exception is thrown for a specific issue, if this should then disable warnings/ notices/errors that would be raised for the same issue. regards, Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
On 27.07.2008, at 15:07, Knut Urdalen wrote: Hi David, That would be great! Currently I need to call the WSDL-file two times to be able to handle the exception. Resolution of this issue is scheduled for alpha2 (around mid to end of August). regards, Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
Hi David, That would be great! Currently I need to call the WSDL-file two times to be able to handle the exception. Knut David Zülke wrote: I know this is horribly old, but I just stumbled across the same issue again and realized it has not been tackled yet. Shouldn't we fix that for 5.3? David Am 08.01.2007 um 14:51 schrieb Knut Urdalen: I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's: class MySoapClient extends SoapClient { public function __construct($wsdl ,$options = array()) { if(is_resource(@fopen($wsdl, 'r'))) { parent::__construct($wsdl, $options); } else { throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); } } } to be able to catch that problem as an Exception. Regards, Knut Urdalen Lukas Kahwe Smith wrote: Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
Okay, we're taking care of that. David Am 23.07.2008 um 22:49 schrieb Lukas Kahwe Smith: Hi, Should not be too hard for someone with C knowledge to produce a fix I would assume. Any takers? Not sure if Dmitry has time for this on such short notice .. regards, Lukas On 23.07.2008, at 20:07, Noah Fontes wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Zülke wrote: I know this is horribly old, but I just stumbled across the same issue again and realized it has not been tackled yet. Shouldn't we fix that for 5.3? David Am 08.01.2007 um 14:51 schrieb Knut Urdalen: I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's: class MySoapClient extends SoapClient { public function __construct($wsdl ,$options = array()) { if(is_resource(@fopen($wsdl, 'r'))) { parent::__construct($wsdl, $options); } else { throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); } } } to be able to catch that problem as an Exception. Regards, Knut Urdalen Lukas Kahwe Smith wrote: Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas +1 for this. Regards, Noah - -- Noah Fontes Bitextender http://www.bitextender.com/ Phone: +1 919 349 9826 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIh3NKhitK+HuUQJQRAmywAKCH7w7pq7r9dV+UHF81Ky7/9XzYOgCgjAGB DopF3tsQm31fzXxDhWYU2S8= =QPf5 -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
Hi, Should not be too hard for someone with C knowledge to produce a fix I would assume. Any takers? Not sure if Dmitry has time for this on such short notice .. regards, Lukas On 23.07.2008, at 20:07, Noah Fontes wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Zülke wrote: I know this is horribly old, but I just stumbled across the same issue again and realized it has not been tackled yet. Shouldn't we fix that for 5.3? David Am 08.01.2007 um 14:51 schrieb Knut Urdalen: I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's: class MySoapClient extends SoapClient { public function __construct($wsdl ,$options = array()) { if(is_resource(@fopen($wsdl, 'r'))) { parent::__construct($wsdl, $options); } else { throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); } } } to be able to catch that problem as an Exception. Regards, Knut Urdalen Lukas Kahwe Smith wrote: Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas +1 for this. Regards, Noah - -- Noah Fontes Bitextender http://www.bitextender.com/ Phone: +1 919 349 9826 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIh3NKhitK+HuUQJQRAmywAKCH7w7pq7r9dV+UHF81Ky7/9XzYOgCgjAGB DopF3tsQm31fzXxDhWYU2S8= =QPf5 -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Zülke wrote: > I know this is horribly old, but I just stumbled across the same issue > again and realized it has not been tackled yet. > > Shouldn't we fix that for 5.3? > > > David > > > > Am 08.01.2007 um 14:51 schrieb Knut Urdalen: > >> I agree with Lukas here, currently you have to be proactive against >> the location of the WSDL-file. I currently do like this in my >> SoapClient's: >> >> class MySoapClient extends SoapClient { >> public function __construct($wsdl ,$options = array()) { >> if(is_resource(@fopen($wsdl, 'r'))) { >> parent::__construct($wsdl, $options); >> } else { >> throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); >> } >> } >> } >> >> to be able to catch that problem as an Exception. >> >> Regards, >> Knut Urdalen >> >> Lukas Kahwe Smith wrote: >>> Hi, >>> >>> why do I get warnings when I have failures in my ext/soap ctor? >>> >>> try { >>> $client = new SoapClient('http://i_dont_exist.com/some.wsdl', >>> array('exceptions' => true)); >>> } catch (Exception $e) { } >>> >>> I guess even without the 'exceptions' => true it should always return >>> all issues as an exception. I think this was agreed upon for >>> constructor errors in PHP5, no? >>> >>> regards, >>> Lukas >>> +1 for this. Regards, Noah - -- Noah Fontes Bitextender http://www.bitextender.com/ Phone: +1 919 349 9826 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIh3NKhitK+HuUQJQRAmywAKCH7w7pq7r9dV+UHF81Ky7/9XzYOgCgjAGB DopF3tsQm31fzXxDhWYU2S8= =QPf5 -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
I know this is horribly old, but I just stumbled across the same issue again and realized it has not been tackled yet. Shouldn't we fix that for 5.3? David Am 08.01.2007 um 14:51 schrieb Knut Urdalen: I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's: class MySoapClient extends SoapClient { public function __construct($wsdl ,$options = array()) { if(is_resource(@fopen($wsdl, 'r'))) { parent::__construct($wsdl, $options); } else { throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); } } } to be able to catch that problem as an Exception. Regards, Knut Urdalen Lukas Kahwe Smith wrote: Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ext/soap ctor errors
I agree with Lukas here, currently you have to be proactive against the location of the WSDL-file. I currently do like this in my SoapClient's: class MySoapClient extends SoapClient { public function __construct($wsdl ,$options = array()) { if(is_resource(@fopen($wsdl, 'r'))) { parent::__construct($wsdl, $options); } else { throw new Exception("Parsing WSDL: Couldn't load from '$wsdl'"); } } } to be able to catch that problem as an Exception. Regards, Knut Urdalen Lukas Kahwe Smith wrote: Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] ext/soap ctor errors
Hi, why do I get warnings when I have failures in my ext/soap ctor? try { $client = new SoapClient('http://i_dont_exist.com/some.wsdl', array('exceptions' => true)); } catch (Exception $e) { } I guess even without the 'exceptions' => true it should always return all issues as an exception. I think this was agreed upon for constructor errors in PHP5, no? regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php