#50544 [NEW]: SOAPServer incorrectly decodes request
| From: | mmalone at nutshell dot com | Date: | Mon, 21 Dec 2009 17:37:06 +0000 |
| Subject: | #50544 [NEW]: SOAPServer incorrectly decodes request | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-146050@lists.php.net to get a copy of this message | ||
From: mmalone at nutshell dot com
Operating system: Mac OS 10.6.2
PHP version: 5.3.1
PHP Bug Type: SOAP related
Bug description: SOAPServer incorrectly decodes request
Description:
------------
When working in non-WSDL mode, SoapServer passes a decoded request that is
missing elements present in the raw string request. I ran into this while
writing a PHP client for handling MS Exchange subscription notifications:
the PHP function that I was using to handle requests was receiving a
stdClass object that did not have the "Id" or "ChangeKey" elements, even
though they were present in request.
Reproduce code:
---------------
$request = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><m:SendNotification
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"><m:ResponseMessages><m:SendNotificationResponseMessage
ResponseClass="Success"><m:ResponseCode>NoError</m:ResponseCode><m:Notification><t:SubscriptionId>FgBleDA3c3AxLmxpdHdhcmVpbmMuY29tEAAAABJAlgb9bHJPjOSIOHbadcA=</t:SubscriptionId><t:PreviousWatermark>AQAAAKBgA1CARqtBm1sPvLCyqCvNaQAAAAAAAAE=</t:PreviousWatermark><t:MoreEvents>false</t:MoreEvents><t:ModifiedEvent><t:Watermark>AQAAAKBgA1CARqtBm1sPvLCyqCvUaQAAAAAAAAE=</t:Watermark><t:TimeStamp>2009-12-21T07:10:06Z</t:TimeStamp><t:ItemId
Id="AAAWAG1tYWxvbmVAbGl0d2FyZWluYy5jb20ARgAAAAAAAoypmxk6K0mPSfdXOELPmwcAKnuHVTIh8kKtS0vk2Ng8DALEfnSYPwAAKnuHVTIh8kKtS0vk2Ng8DALQCov5BwAA"
ChangeKey="DwAAAA==" /><t:ParentFolderId
Id="AAAWAG1tYWxvbmVAbGl0d2FyZWluYy5jb20ALgAAAAAAAoypmxk6K0mPSfdXOELPmwEAKnuHVTIh8kKtS0vk2Ng8DALEfnSYPwAA"
ChangeKey="AQAAAA=="
/></t:ModifiedEvent></m:Notification></m:SendNotificationResponseMessage></m:ResponseMessages></m:SendNotification></soap:Body></soap:Envelope>';
function SendNotification($response) {
print_r($response); die;
}
$server = new SoapServer(NULL, array('soap_version' => SOAP_1_2, 'uri' =>
'http://192.68.1.27/api/v1/exchange'));
$server->addFunction('SendNotification');
$server->handle($request);
~
Expected result:
----------------
stdClass Object
(
[SendNotificationResponseMessage] => stdClass Object
(
[ResponseCode] => NoError
[Notification] => stdClass Object
(
[SubscriptionId] =>
FgBleDA3c3AxLmxpdHdhcmVpbmMuY29tEAAAABJAlgb9bHJPjOSIOHbadcA=
[PreviousWatermark] =>
AQAAAKBgA1CARqtBm1sPvLCyqCvNaQAAAAAAAAE=
[MoreEvents] => false
[ModifiedEvent] => stdClass Object
(
[Watermark] =>
AQAAAKBgA1CARqtBm1sPvLCyqCvUaQAAAAAAAAE=
[TimeStamp] => 2009-12-21T07:10:06Z
[ItemId] => stdClass Object
(
[Id] =>
AAAWAG1tYWxvbmVAbGl0d2FyZWluYy5jb20ARgAAAAAAAoypmxk6K0mPSfdXOELPmwcAKnuHVTIh8kKtS0vk2Ng8DALEfnSYPwAAKnuHVTIh8kKtS0vk2Ng8DALQCov5BwAA
[ChangeKey] => DwAAAA==
)
[ParentFolderId] => stdClass Object
(
[Id] =>
AAAWAG1tYWxvbmVAbGl0d2FyZWluYy5jb20ALgAAAAAAAoypmxk6K0mPSfdXOELPmwEAKnuHVTIh8kKtS0vk2Ng8DALEfnSYPwAA
[ChangeKey] => AQAAAA==
)
)
)
)
)
Actual result:
--------------
stdClass Object
(
[SendNotificationResponseMessage] => stdClass Object
(
[ResponseCode] => NoError
[Notification] => stdClass Object
(
[SubscriptionId] =>
FgBleDA3c3AxLmxpdHdhcmVpbmMuY29tEAAAABJAlgb9bHJPjOSIOHbadcA=
[PreviousWatermark] =>
AQAAAKBgA1CARqtBm1sPvLCyqCvNaQAAAAAAAAE=
[MoreEvents] => false
[ModifiedEvent] => stdClass Object
(
[Watermark] =>
AQAAAKBgA1CARqtBm1sPvLCyqCvUaQAAAAAAAAE=
[TimeStamp] => 2009-12-21T07:10:06Z
[ItemId] =>
[ParentFolderId] =>
)
)
)
)
--
Edit bug report at http://bugs.php.net/?id=50544&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50544&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50544&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50544&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50544&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50544&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50544&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50544&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50544&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50544&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50544&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50544&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50544&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50544&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50544&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50544&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50544&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50544&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50544&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50544&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50544&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50544&r=mysqlcfg