jasonramsden / php-ews

Automatically exported from code.google.com/p/php-ews
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Missing files on creation of calendar item #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Well, I was trying to create an item in the calendar and I encountered with two 
errors:

1. Missing "Subject" property for CalendarItemType
2. Missing file "CalendarItemCreateOrDeleteOperationType", that has constants 
that define the send method policy on item creation.
2.a. Missing file "CalendarItemUpdateOperationType", that has constants that 
define the send method policy on item update.

I added the missing subject property and created the two files missing based on 
the enumeration in "types.xsd". Hope this will help.

Actual code to insert a calendar item:

$ews = new ExchangeWebServices($host, $username, $password);
// start building the find request
$request = new EWSType_CreateItemType();
$request->Items = new EWSType_NonEmptyArrayOfAllItemsType();
$request->Items->CalendarItem = new EWSType_CalendarItemType();

// configure the view
$request->Items->CalendarItem->Subject = "Basic Calendar Item Insertion";
$request->SendMeetingInvitations = 
EWSType_CalendarItemCreateOrDeleteOperationType::SEND_TO_NONE;
//$request->SendMeetingInvitationsSpecified = true;
$response = $ews->CreateItem($request);
echo '<pre>'.print_r($response, true).'</pre>';

Original issue reported on code.google.com by daare...@gmail.com on 23 Aug 2010 at 2:10

Attachments:

GoogleCodeExporter commented 9 years ago
Didn´t work for me! :/ I get this message:

{{{
stdClass Object
(
    [ResponseMessages] => stdClass Object
        (
            [CreateItemResponseMessage] => stdClass Object
                (
                    [MessageText] => SendMeetingInvitations attribute is required for calendar items.
                    [ResponseCode] => ErrorSendMeetingInvitationsRequired
                    [DescriptiveLinkKey] => 0
                    [ResponseClass] => Error
                    [Items] => stdClass Object
                        (
                        )

                )

        )

)
}}}

Tried to use:

{{{
https://red002.mail.emea.microsoftonline.com/EWS/Exchange.asmx
}}}

Original comment by a.fied...@oe-konzept.de on 16 Feb 2011 at 1:51

GoogleCodeExporter commented 9 years ago
Ok, got it working. I´ve set it to the requests item, not the request... bad. 
;o)

Original comment by a.fied...@oe-konzept.de on 16 Feb 2011 at 1:56

GoogleCodeExporter commented 9 years ago
Hi, thank you for remember me this project, I have modified the library and get 
it working in a production environment to create, delete, update and read items 
from and to the calendar. I will send it right now to James for a future 
release.

Original comment by daare...@gmail.com on 16 Feb 2011 at 3:10

GoogleCodeExporter commented 9 years ago
That´s really great! I love social coding, just for this. :o) You made my day. 
;o) I got all working, too. (create, update, delete) But i had a lot to google, 
the necessary information was spread all over the web. This will definitely 
help a lot of people.

greetings André

Original comment by fiedler....@gmail.com on 16 Feb 2011 at 3:17

GoogleCodeExporter commented 9 years ago
I had this problem too, this topic really helped me so thanks a lot guys!
Now I can add and edit an event without problems, but only the calendar of the 
person logged in with.
Is there a way I can add/edit the calendars of other users if I login with an 
admin account?
If yes, how? I don't know how to get their calendars!
I don't want ot have their password for each of them, so that would realy help 
me!
Note: we don't want shared calendars, everyone has his own calendars!

Original comment by nenes...@gmail.com on 22 Apr 2011 at 9:49

GoogleCodeExporter commented 9 years ago
Great, that is great!!, thaks for the code. [°_°]

Original comment by rdigita...@gmail.com on 18 Jan 2012 at 9:30

GoogleCodeExporter commented 9 years ago
Has someone a solution to nenes...es problem.
I have the same issue to add entries to someone elses calendar, without knowing 
their passwords.

Another Question, what about the body text.
I do not see a body property in EWSType_CalendarItemType.

But nevertheless, really great code. Saved me a lot of time.

Original comment by Juerg.vo...@gmail.com on 20 Jan 2012 at 8:50

GoogleCodeExporter commented 9 years ago
Finaly this solution didn't have the required functions I needed.
So i changed my solution :
I use a Web Service coded in C# (framework 4.0) with the EWS API :
http://msdn.microsoft.com/en-us/library/dd633709(v=EXCHG.80).aspx
What is great in this solution, is that I can impersonate the different users 
with only their login or email adress and then I can send mail, add meetings, 
events and contacts. A great API I recommand and I am now integrating it in a 
Silverlight application.
Sorry I can't help more with this API.
Then I call this web service in my PHP pages.

Original comment by nenes...@gmail.com on 20 Jan 2012 at 9:41

GoogleCodeExporter commented 9 years ago
This issue has been moved to GitHub 
https://github.com/jamesiarmes/php-ews/issues/7

Original comment by JamesIArmes@gmail.com on 14 Feb 2012 at 2:38