From:             rtroll at yahoo-inc dot com
Operating system: 
PHP version:      5CVS-2005-02-26 (dev)
PHP Bug Type:     SOAP related
Bug description:  ComplexType Encoding Incorrect

Description:
------------
When encoding a complex array datatype (via a doc/literal request); the
encoding is incorrect.  The following code performs a request, and
displays the request/response structures.  The server is unable to locate
the client supplied params, due to the request being (I believe)
incorrect.

Additionally, PHP appears to not be sending over array element 0 in this
demo.

Reproduce code:
---------------
<?php
$WSDL = "http://ws1.api.re2.yahoo.com/ws/soap-demo/full.wsdl";;
$DEBUG=true;

$client = new SoapClient( $WSDL, array( "trace" => $DEBUG,
                                        "exceptions" => 0,
                                        ));

function dump_xml( $title, $body )
{
    $nl = preg_replace( "/\>\</", ">\n<", $body );
    $clean = htmlspecialchars( $nl );
    print "\n<b>$title</b>\n<pre>$clean</pre>\n";
}

$r = $client->strArrayReverse('This', 'is', 'a', 'test', '.');
dump_xml( "Request", $client->__getLastRequest() );
dump_xml( "Response", $client->__getLastResponse() );
?>


Expected result:
----------------
The request should be:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:yahoo:platform:soap:demo:full">
<SOAP-ENV:Body>
 <ns1:strArrayReverse>
 <ns1:saVal>
 <param0>This</param0>
<param1>is</param1>
<param2>a</param2>
<param3>test</param3>
<param4>.</param4>
 </ns1:saVal>
 </ns1:strArrayReverse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Note that the method being accessed (strArrayReverse) now contains a
single arg (saVal), which is an array of 5 elements.  Also note that
param0 is present.

This request will elicit the correct response from the server.

Indent lines indicate lines that have been added, or changed, compared to
the original request sent from PHP.

Actual result:
--------------
The request being generated by PHP's soap interface is:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:yahoo:platform:soap:demo:full">
<SOAP-ENV:Body>
<ns1:strArrayReverse/>
<param1>is</param1>
<param2>a</param2>
<param3>test</param3>
<param4>.</param4>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


-- 
Edit bug report at http://bugs.php.net/?id=32117&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32117&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32117&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32117&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32117&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32117&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32117&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32117&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32117&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32117&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32117&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32117&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32117&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32117&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32117&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32117&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32117&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32117&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32117&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32117&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32117&r=mysqlcfg

Reply via email to