php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47924 Exchange 2007: UpdateItem: Fatal error: SOAP-ERROR: Encoding: object hasn't 'Pat
Submitted: 2009-04-08 10:55 UTC Modified: 2009-05-12 08:04 UTC
Votes:31
Avg. Score:4.8 ± 0.4
Reproduced:29 of 29 (100.0%)
Same Version:13 (44.8%)
Same OS:11 (37.9%)
From: philipp at kolmann dot at Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.9 OS: Linux, Debian Sid
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 - 4 = ?
Subscribe to this entry?

 
 [2009-04-08 10:55 UTC] philipp at kolmann dot at
Description:
------------
I am using PHP and SOAP to talk to a Exchange 2007 server. Adding items works without a Problem. Now I wanted to update an Item:

The Request looks quite promising, but seems to fail some XML validation.

Regarding to the MS Docs (http://msdn.microsoft.com/en-us/library/aa581022.aspx) The Path element is an abstract element that is substituted by FieldURI. This seems not to happen.

If needed I can add the wsdl-files.

Thanks
Philipp

Reproduce code:
---------------
$UpdateItem->MessageDisposition ="SaveOnly";
$UpdateItem->ConflictResolution="AutoResolve";
$UpdateItem->ItemChanges->ItemChange->ItemId->Id = $item->ItemId->Id;
$UpdateItem->ItemChanges->ItemChange->ItemId->ChangeKey = $item->ItemId->ChangeKey;
$UpdateItem->ItemChanges->ItemChange->Updates->SetItemField->FieldURI->FieldURI = "item:Sensitivity";
$UpdateItem->ItemChanges->ItemChange->Updates->SetItemField->Message->Sensitivity = "Normal";

$res = $client->UpdateItem($UpdateItem);

Expected result:
----------------
Request beeing properly sent to Exchange Server.

Actual result:
--------------
stdClass Object
(
    [MessageDisposition] => SaveOnly
    [ConflictResolution] => AutoResolve
    [ItemChanges] => stdClass Object
        (
            [ItemChange] => stdClass Object
                (
                    [ItemId] => stdClass Object
                        (
                            [Id] => AAAeAHBrb2xtYW5uQGthbGVuZGVyLnR1d2llbi5hYy5hdABGAAAAAACkwH79RYBrRLOe5dwPwABJBwCWSqnpWEwlT7Z+LCzPQIE9AAAAAYXBAABeyHGqwz04TojssSJ14nFUADMmYzOVAAA=
                            [ChangeKey] => DwAAABYAAABeyHGqwz04TojssSJ14nFUADMmZDks
                        )

                    [Updates] => stdClass Object
                        (
                            [SetItemField] => stdClass Object
                                (
                                    [FieldURI] => stdClass Object
                                        (
                                            [FieldURI] => item:Sensitivity
                                        )

                                    [Message] => stdClass Object
                                        (
                                            [Sensitivity] => Normal
                                        )

                                )

                        )

                )

        )

)

Fatal error: SOAP-ERROR: Encoding: object hasn't 'Path' property in addtermin.php on line 87

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-06 21:45 UTC] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2009-05-12 08:04 UTC] philipp at kolmann dot at
This sample will give you the error described in the Bugreport. You will need the Services.wsdl, messages.xsd and types.xsd from an Exchange 2007 Server. With our Exchange I was able to trigger the error with this script.

<?php
// Create SOAP Client
$client = new SoapClient('Services.wsdl',
           array('exceptions' => 0,
                 'trace' => 1,
                 'login'    => "DOMAIN\\user",
                 'password' => "PASSWORD"
           ));

// Update found item
$UpdateItem->MessageDisposition ="SaveOnly";
$UpdateItem->ConflictResolution="AutoResolve";
$UpdateItem->ItemChanges->ItemChange->ItemId->Id = "ItemID from FindItem";
$UpdateItem->ItemChanges->ItemChange->ItemId->ChangeKey = "ChangeKey from FindItem";
$UpdateItem->ItemChanges->ItemChange->Updates->SetItemField = "item:Sensitivity";
print "<pre>";
print_r($UpdateItem);
$res = $client->UpdateItem($UpdateItem);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; 
print_r($res);
print "</pre>";
?>
 [2012-02-14 10:17 UTC] philipp at kolmann dot at
Hi,

it seems that noone ever cared about this Bug :(

I am still having the same issues with Exchange 2010 and PHP Version 5.3.10-1.

Here is the sample code still not working:

<?php
// Create SOAP Client
$client = new SoapClient('Services.wsdl',
           array('exceptions' => 0,
                 'trace' => 1,
                 'login'    => "DOMAIN\\user",
                 'password' => "PASSWORD"
           ));

// Update found item
$UpdateItem->MessageDisposition ="SaveOnly";
$UpdateItem->ConflictResolution="AutoResolve";
$UpdateItem->ItemChanges->ItemChange->ItemId->Id = "ItemID from FindItem";
$UpdateItem->ItemChanges->ItemChange->ItemId->ChangeKey = "ChangeKey from FindItem";
$UpdateItem->ItemChanges->ItemChange->Updates->SetItemField = "item:Sensitivity";
$UpdateItem->ItemChanges->ItemChange->Updates->SetItemField->Message->Sensitivity = "Normal";
print "<pre>";
print_r($UpdateItem);
$res = $client->UpdateItem($UpdateItem);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; 
print_r($res);
print "</pre>";
?>


Is there any hope, that someone might fix this?
Thanks
Philipp
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC