php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39515 SOAP fault detail does not contain attributes
Submitted: 2006-11-14 21:25 UTC Modified: 2006-11-23 09:31 UTC
From: david at acz dot org Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.2.0 OS: SuSE Linux 9.3
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at acz dot org
New email:
PHP Version: OS:

 

 [2006-11-14 21:25 UTC] david at acz dot org
Description:
------------
Attributes from tags inside a SOAP fault detail are not returned in the SoapFault object.  Below is a SOAP fault XML response and associated SoapFault object.  Notice that the attributes for the "keyword" tag are missing.

Reproduce code:
---------------
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="(ELIDED)">ns1:badKeywords</faultcode>
<faultstring>error string here</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">test.example.com</ns2:hostname>
<keyword reason="foobar" value="hello"/>
</detail>
</soapenv:Fault>
</soapenv:Body></soapenv:Envelope>

Expected result:
----------------
SoapFault Object
(
    [message:protected] => error string here
    [string:private] =>
    [code:protected] => 0
    [file:protected] => hello.php
    [line:protected] => 166
    [trace:private] => Array (ELIDED)
    [faultstring] => error string here
    [faultcode] => ns1:badKeywords
    [detail] => stdClass Object
        (
            [hostname] => test.example.com
            [keyword] => (ATTRIBUTES "reason" AND "value")
        )
)


Actual result:
--------------
SoapFault Object
(
    [message:protected] => error string here
    [string:private] =>
    [code:protected] => 0
    [file:protected] => hello.php
    [line:protected] => 166
    [trace:private] => Array (ELIDED)
    [faultstring] => error string here
    [faultcode] => ns1:badKeywords
    [detail] => stdClass Object
        (
            [hostname] => test.example.com
            [keyword] =>
        )
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-15 17:09 UTC] dmitry@php.net
XML attributes are handled only if they are properly described in WSDL file. Do you use any WSDL file? Can you post WSDL file and PHP code?
 [2006-11-15 20:10 UTC] david at acz dot org
The service requires authentication, so unfortunately I cannot provide a complete example, but this is the WSDL and how I am using it:

https://client.enhance.com/plm/services/CampaignWebService?wsdl

$client = new SoapClient($wsdl, array("exceptions" => 0));
$x = (DETAILS ELIDED)
$r = $client->addKeywords($x);
if (is_soap_fault($r))
{
    // $r->detail is missing attributes
}
 [2006-11-23 09:31 UTC] dmitry@php.net
The wsdl file doesn't describe fault massage at all.

ext/soap can handle only known attributes of known types, but wsdl says nothing about <keyword reason="foobar" value="hello"/>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 12:01:27 2025 UTC