ID: 50544 User updated by: mmalone at nutshell dot com Reported By: mmalone at nutshell dot com Status: Open Bug Type: SOAP related Operating System: Mac OS 10.6.2 PHP Version: 5.3.1 New Comment:
The line wrapping in the reproduce code causes problems. Here's a version on pastebin: http://pastebin.com/f34c966a0 Previous Comments: ------------------------------------------------------------------------ [2009-12-21 17:37:06] mmalone at nutshell dot com 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 this bug report at http://bugs.php.net/?id=50544&edit=1