Comments (33)
Good question, I'm not sure. I'll look in to it tomorrow
from php-ews.
This should now work in 0.8.3
from php-ews.
Hi,
thanks for helping so fast.
I just pulled 8.3 and get an error when setting multiple properties:
[garethp\ews\API\Exception\ExchangeException]
Property is not valid for this object type.
Maybe i am using wrong syntax? Do i have to add
Also when i try to delete the field (worked with 8.2) i get the error
[SoapFault]
The request failed schema validation: The 'FieldURI' attribute is invalid - The value '' is invalid according to its datatype 'http://schemas.microsoft.com/exc
hange/services/2006/types:UnindexedFieldURIType' - The Enumeration constraint failed.
from php-ews.
Huh, that's really weird. This set of code works for me. Can you test it? What does your code look like?
$contact = $api->createContacts(array(
'GivenName' => 'John',
'Surname' => 'Smith',
'EmailAddresses' => array(
'Entry' => array('Key' => Enumeration\EmailAddressKeyType::EMAIL_ADDRESS_1, '_value' => '[email protected]')
),
//Creating multiple entries
'PhoneNumbers' => array(
'Entry' => array(
array('Key' => Enumeration\PhoneNumberKeyType::HOME_PHONE, '_value' => '000'),
array('Key' => Enumeration\PhoneNumberKeyType::BUSINESS_PHONE, '_value' => '111'),
)
),
'PhysicalAddresses' => array(
'Entry' => array(
'Key' => Enumeration\PhysicalAddressKeyType::HOME,
'street' => '123 Street',
'city' => '123 City',
'state' => '123 State',
'countryOrRegion' => '123 Country',
'postalCode' => '12345',
)
),
))[0];
$api->updateContactItem($contact, array(
'GivenName' => 'Jane',
'EmailAddress:EmailAddress1' => array (
'EmailAddresses' => array (
'Entry' => array('Key' => 'EmailAddress1', '_value' => '[email protected]')
)
),
'PhysicalAddress:Home' => array(
'PhysicalAddresses' => array(
'Entry' => array(
'Key' => 'Home',
'street' => '123 Street New',
'city' => '123 City New',
)
)
)
));
$api->updateContactItem($contact, array(
'deleteFields' => array(
'GivenName',
'PhoneNumber:HomePhone'
)
));
$api->deleteItems($contact);
from php-ews.
'Entry' => array(
'Key' => 'Home',
'street' => '123 Street New',
'city' => '123 City New',
'countryOrRegion' => '1234',
)
countryOrRegion does not work
from php-ews.
Also i am deleting in the same request where i am updating fields. Something like that
'PhysicalAddress:Home' => array(
'PhysicalAddresses' => array(
'Entry' => array(
'Key' => 'Home',
'street' => '123 Street New',
'city' => '123 City New',
)
)
deleteFields' => array(
'PhysicalAddress:BUSINESS,
)
If you need more information i can post the complete request.
from php-ews.
I think I see the issue. It looks like the constants for URI's may be incomplete. I can push it quickly, but before I do: What other fields do you need updating? If there are any that aren't defined yet, I'd like to have them all defined in the next release
from php-ews.
PhysicalAddressKeyType::HOME
PhysicalAddressKeyType::BUSINESS
PhysicalAddressKeyType::OTHER
'street'
'city'
'state'
'countryOrRegion'
'postalCode'
Are these the ones you mean?
Also i was not able to sync the notes-field, maybe it is also related to missing uris?
from php-ews.
And of course all PhoneNumberKeyType and EmailAddressKeyType
from php-ews.
PostalCode would have been missing too. What do you mean by not being able to sync the notes field?
from php-ews.
'Notes' => 'notestring'
[SoapFault]
The request failed schema validation: The 'FieldURI' attribute is invalid - The value 'contacts:Notes' is invalid according to its datatype 'http://schemas.mic
rosoft.com/exchange/services/2006/types:UnindexedFieldURIType' - The Enumeration constraint failed.
from php-ews.
Hm... I'll look in to that. That one is strange, as it should exist...
from php-ews.
Okay, version 0.8.4
should now have your fields updatable, except for notes. I'm not sure why notes doesn't update, but I'll be looking in to that
from php-ews.
Hi, updating works with 0.8.4 but
deleteFields' => array(
'PhysicalAddress:BUSINESS,
)
in the same request still does not
[SoapFault]
The request failed schema validation: The 'FieldURI' attribute is invalid - The value '' is invalid according to its datatype 'http://schemas.microsoft.com/exc
hange/services/2006/types:UnindexedFieldURIType' - The Enumeration constraint failed.
from php-ews.
Hm... to be honest I can't see how to delete a whole address. You'd have to delete it one field at a time as far as I can see. The problem lies in the fact that PhysicalAddresses is not an indexed field, so you can't attach an index on that, and PhysicalAdress by itself isn't a field either. The only valid PhysicalAddress URI's are:
contacts:PhysicalAddress:City
contacts:PhysicalAddress:Country
contacts:PhysicalAddress:PostalCode
contacts:PhysicalAddress:State
contacts:PhysicalAddress:Street
So there's just no fieldURI to delete a single physicalAddress.
I'll post an issue on SO in raw XML to see if I can get a response on what the request should look like
from php-ews.
Out of curiosity, what are you building with this? It seems like you're touching on a pretty large feature set.
from php-ews.
Yeah, seems like the issue is to just delete every field. Can you pull down dev-master and give it a try? I've got this working on dev-master
$api->updateContactItem($contact, array(
'deleteFields' => array(
'GivenName',
'PhysicalAddress:Home',
'PhysicalAddress:City:Business'
)
));
from php-ews.
Hey, i will try if it works. I am syncing contacts from a local database with exchange contacts. Contacts on Exchange need to be updated on a regular basis. I am using a custom property to map exchange contacts to local contacts.
from php-ews.
[SoapFault]
Die Anforderung ist gültig, sie gibt jedoch nicht die richtige Serverversion in der SOAP-Kopfzeile "RequestServerVersion" an. Stellen Sie sicher, dass die SOAP
-Kopfzeile "RequestServerVersion" auf den richtigen "RequestServerVersionValue" festgelegt ist.
Means something like the request is valid but RequestServerVersion has not the right RequestServerVersionValue. I think it is an Exchange 2010 Server. Tested with 97c1939
from php-ews.
Interesting. Are you specifying a version when you create the API? Can you try getting the API through the ExchangeAutodiscover::getAPI($username, $password)
function? If it can autodiscover your server, it should get the correct version for your server
from php-ews.
I do not specifiy a version but it was working with 0.8.4. When i specify the version i get an error that the property is not valid. May be invalid syntax by me but was working with 0.8.4. At the moment i have to work on another project, so i do not have time to investigate in-depth.
from php-ews.
I can understand that. I'll keep looking in to it, but I'm unable to reproduce your error. I'll see if there's a way I can get an Exchange 2010 server to test on, but I'm not sure if I'll be able to do it.
from php-ews.
I can create an example request as soon as i find some time.
from php-ews.
This might be a long shot, but would it be possible for you to create a test account on your Exchange server for me to test against directly? That way I can debug it personally instead of constantly asking you to get debug data for me?
from php-ews.
I use a hosted exchange server so sadly i am not able to create new accounts.
from php-ews.
Fair enough. I'll try to create a 2010 server in a virtual machine to see if I can reproduce
from php-ews.
If you can dump the XML request (Chuck a var_dump($request)
at NTLMSoapClient::__doRequest()
) for both the current dev-master
and 0.8.4
, then I should be able to do a diff and see why it's rejecting the ServerVersion.
Sorry this is taking so long to resolve, I've just never tried to do what you're doing or encountered the errors you're encountering
from php-ews.
Hi, no problem that it is taking time. It is not a matter of course to give as much support as you do. When everything is working i may be able to update the documentation on how to sync contacts from a database.
from php-ews.
Just an FYI: If I can't find a way to update Notes, you may be able to use the Body attribute insteaad, in the same way you would for emails
from php-ews.
Hi, after some testing it was invalid propertys on my side. Nearly everything is working with Exchange2010 if I specify the version. When creating addresses all properties are working as expected but when updating 'countryOrRegion' and 'postalCode' do not.
from php-ews.
Okay, I'll look in to that, thanks
from php-ews.
Can you give updating countryOrRegion
and postalCode
a shot on the latest dev-master
? I should have it fixed. Just wanted to get a confirmation before I tag a new release
from php-ews.
countryOrRegion and postalCode are working now.
from php-ews.
Related Issues (20)
- Create a contact
- internetMessageHeaders HOT 1
- BUG FreeBusyResponse array HOT 1
- toRecipients getting null values for inplace archive mails
- Update Mail Item -> Categorize Email HOT 1
- PHP 8.2 - Deprecated dynamic properties HOT 5
- Oauth is not working with Exchange 2013
- Issue with using toRecipients property in EWS restriction HOT 2
- Daylight Savings
- How to get medias appointment
- Update contact with ExtendedProperty
- Exceptions
- Set a calendar event with custom identifier, so that I can (later on) GET an event by the same identifier HOT 3
- Change "busy" status for event. HOT 2
- Checking if an item exists (by $itemId and $changeKey) results in FATAL ERROR if the object is not found - How to handle this? HOT 1
- Also delete recurring events when master event is deleted? HOT 1
- getLegacyFreeBusyStatus() does not return WorkingElsewhere HOT 1
- Authentication error after Exchange Extended Protection was enabled HOT 2
- Add Kerberos support
- How to forward an Email
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-ews.