From:             rtroll at yahoo-inc dot com
Operating system: 
PHP version:      5CVS-2005-02-28 (dev)
PHP Bug Type:     SOAP related
Bug description:  dateTime decoding: not present

Description:
------------
When using the PHP SOAP client to send over a dateTime object; the client
correctly turns a unix timestamp into the appropriate XML dateTime
object.

When using the PHP SOAP ext to write a SOAP service; the value is not
decoded.

Using the WSDL available via:

  http://ws1.api.re2.yahoo.com/ws/soap-demo/full-php.wsdl

a PHP5 SOAP client will send a request containing a dateTime encoded
entity:

  <ns1:dtval>2005-02-28T12:40:51-0800</ns1:dtval>

based on calling the function with a Unix timestamp:

  $client->dateInfo(array( 'dtval' => time() ));



However, a PHP5 SOAP server receiving the request:

  <ns1:dtval>2005-02-28T12:40:51-0800</ns1:dtval>

does not decode the dateTime object into a time_t.  Instead, it passes the
raw value to the service method.



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

function dateInfo( $req )
{
    $dtval = $req->dtval;
    error_log("Returned $dtval", 0);
    return ( array( 'dateString' => "no ctime function",
                    'dateSeconds' => $dtval ));
}

ini_set("soap.wsdl_cache_enabled", "0"); // Disable WSDL caching
$server = new SoapServer( $WSDL );
$server->addFunction("dateInfo");         # 2
$server->handle();
?>


Expected result:
----------------
When using a SOAP client that hits the above script; I would expect the
error log to contain:

[...] [error] Returned 1234567890

instead, it's returning:

[...] [error] Returned 2005-02-28T19:22:24Z



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

Reply via email to