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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: philipp at kolmann dot at
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 15:01:29 2024 UTC