#39515 [Opn->Asn]: SOAP fault detail does not contain attributes
| From: | tony2001@php.net | Date: | Thu, 16 Nov 2006 00:01:14 +0000 |
| Subject: | #39515 [Opn->Asn]: SOAP fault detail does not contain attributes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105043@lists.php.net to get a copy of this message | ||
ID: 39515
Updated by: tony2001@php.net
Reported By: david at acz dot org
-Status: Open
+Status: Assigned
Bug Type: SOAP related
Operating System: SuSE Linux 9.3
PHP Version: 5.2.0
Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2006-11-15 20:10:43] 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-15 17:09:20] 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-14 21:25:25] 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] =>
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39515&edit=1