Re: [SOAP] Re: E_ERROR in SoapClient

[email protected] (David Zülke)
Newsgroups php.soap
Message-ID <[email protected]>
However, that doesn't happen if the WSDL cannot be loaded at all IIRC  
(e.g. on a 404).

- David



On 31.07.2009, at 17:52, Richard Quadling wrote:

> 2009/7/31 Richard Quadling <[email protected]>:
>> 2009/7/31 Paulo Azevedo <[email protected]>:
>>> My problem is that SoapClient triggers a E_ERROR ( Fatal Error )  
>>> instead of
>>> throwing an Exception.
>>> Since E_ERROR cannot be catchable I don't find a way to gracefully  
>>> handly
>>> this problem.
>>>
>>> PHP Fatal error:  SOAP-ERROR: Encoding: object hasn't  
>>> 'profileData' property
>>>
>>>
>>> Is there any way to gracefully catch this error?
>>>
>>> --
>>> -Paulo
>>> http://twitter.com/halufa
>>>
>>
>> You can tell the SoapClient to generate exceptions rather than  
>> errors.
>>
>> [1] "The exceptions option is a boolean value defining whether soap
>> errors throw exceptions of type SoapFault."
>>
>> Regards,
>>
>> Richard.
>>
>> [1] http://docs.php.net/manual/en/soapclient.soapclient.php
>> --
>> -----
>> Richard Quadling
>> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
>> "Standing on the shoulders of some very clever giants!"
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>
> <?php
> try
> 	{
> 	$client=new SoapClient('http://api.rkd.reuters.com/schemas/wsdl/Charts_1_HttpAndRKDToken.wsdl' 
> ,
> array('exceptions' => True));
> 	}
> catch(Exception $exception)
> 	{
> 	echo $exception;
> 	}
> echo 'Finished';
>
>
> outputs ...
>
> SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unknown required
> WSDL extension 'http://schemas.xmlsoap.org/wsdl/soap/' in
> Z:\soapbad.php:4
> Stack trace:
> #0 Z:\soapbad.php(4): SoapClient->SoapClient('http://api.rkd....',  
> Array)
> #1 {main}Finished
>
>
>
> -- 
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
smime.p7s (application/pkcs7-signature, 2.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.