ID:               39357
 Updated by:       [EMAIL PROTECTED]
 Reported By:      yaksenov at iponweb dot net
-Status:           Assigned
+Status:           Bogus
 Bug Type:         SOAP related
 Operating System: gentoo-linux
 PHP Version:      5.2.0
 Assigned To:      dmitry
 New Comment:

Your test code has two mistakes.

In client.php you should use "loginFault" as fault name (not
"exception_detail").

In wsdl file you refer to elemnt named "types:exception_detail", but
you don't declare such element (only type). To declare it change
gen.xsd

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:types="http://api.mymanager.com/types";
targetNamespace="http://api.mymanager.com/types";>
  <xsd:element name="exception_detail">
  <xsd:complexType>
    <xsd:all>
      <xsd:element name="code" type="xsd:string" minOccurs="0"/>
    </xsd:all>
  </xsd:complexType>
  </xsd:element>
</xsd:schema>

After fix this errors you can also remove SoapVar creation and pass
exception_detail object directly to SoapFault constructor.



Previous Comments:
------------------------------------------------------------------------

[2006-11-03 11:18:32] yaksenov at iponweb dot net

updated code to reproduce the behavior - client.pl added
http://rapidshare.com/files/1796872/soap_fault_detail_post.tar.gz
MD5: fde0f911544e2096c4e992d23b1df0e8

------------------------------------------------------------------------

[2006-11-03 10:01:11] yaksenov at iponweb dot net

Description:
------------
SoapFault->__construct() with 'faultname' causes wrong 
fault response: the <detail> node is absent.

Reproduce code:
---------------
http://rapidshare.com/files/1788815/soap_fault_detail_post.tar.gz

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns1="http://api.mymanager.com/types"; 
xmlns:ns2="urn:ContactService" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>always throw exception</faultstring>
      
<faultactor>http://localhost/soap_fault_detail/contact.php</faultactor>
      <detail>
        <ns2:exception_detail 
xsi:type="ns1:exception_detail">
          <code xsi:type="xsd:string">access</code>
        </ns2:exception_detail>
      </detail>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Actual result:
--------------
 <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ns1="http://api.mymanager.com/types";>
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>always throw exception</faultstring>
      
<faultactor>http://localhost/soap_fault_detail/contact.php</faultactor>
      <exception_detail xsi:type="ns1:exception_detail">
        <code>access</code>
      </exception_detail>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39357&edit=1

Reply via email to