php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52726 getCode() from SoapFault thrown from call to AWS 3.0 returns HTTP not 410 4
Submitted: 2010-08-28 22:53 UTC Modified: -
From: zippy1981 at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.3 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zippy1981 at gmail dot com
New email:
PHP Version: OS:

 

 [2010-08-28 22:53 UTC] zippy1981 at gmail dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC