Bug #52726 [NEW]: getCode() from SoapFault thrown from call to AWS 3.0 returns HTTP not 410 4
| From: | zippy1981 at gmail dot com | Date: | Sat, 28 Aug 2010 20:53:36 +0000 |
| Subject: | Bug #52726 [NEW]: getCode() from SoapFault thrown from call to AWS 3.0 returns HTTP not 410 4 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-153886@lists.php.net to get a copy of this message | ||
From:
Operating system: All
PHP version: 5.3.3
Package: SOAP related
Bug Type: Bug
Bug description:getCode() from SoapFault thrown from call to AWS 3.0 returns HTTP not 410 4
Description:
------------
Exception::getCode() should return an int as per the documentation.
Therefore
SoapFault::getCode() should return the http code.
If you make a soap call to the deprecated Amazon Web Service 3.0 wsdl, a
html 410
(Gone) error is returned. SoapFault::getCode() and SoapFault::faultcode
should
both be 410, but they are HTTP.
Test script:
---------------
<?php
$client = new
SoapClient('http://soap.amazon.com/schemas2/AmazonWebServices.wsdl',
array('trace' => true));
$request = array(
'keyword' => 'Stuff',
'page' => '1',
'mode' => 'books',
'tag' => 'you\'re it',
'type' => 'medium',
'devtag' => 'YOUR-TOKEN-HERE'
);
try {
$client->KeywordSearchRequest($request);
}
catch (SoapFault $ex) {
if ($ex->faultstring != 'Gone') throw $ex;
if ($ex->getCode() != '410') {
echo "UnexpectedCode: " . $ex->getCode();
throw $ex;
}
}
Expected result:
----------------
Nothing
Actual result:
--------------
UnexpectedCode: 0PHP Fatal error: Uncaught SoapFault exception: [HTTP]
Gone in
/home/zippy/src/testfest/ext/soap/tests/client_error001.phpt:20
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...',
'http://soap.ama...', 'http://soap.ama...', 1, 0)
#1 [internal function]: SoapClient->__call('KeywordSearchRe...', Array)
#2 /home/zippy/src/testfest/ext/soap/tests/client_error001.phpt(20):
SoapClient-
>KeywordSearchRequest(Array)
#3 {main}
thrown in /home/zippy/src/testfest/ext/soap/tests/client_error001.phpt on
line
20
--
Edit bug report at http://bugs.php.net/bug.php?id=52726&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52726&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52726&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52726&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52726&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52726&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52726&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52726&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52726&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52726&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52726&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52726&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52726&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52726&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52726&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52726&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52726&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52726&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52726&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52726&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52726&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52726&r=mysqlcfg