Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-2007, 07:26 AM
Special Member
 
Posts: 151
Default [SOLVED] Invite_out_of_date

I'm trying to update a calendar invite using soap and php.

I sent:

Code:
<ModifyAppointmentRequest id="206297" comp="0" xmlns="urn:zimbraMail">
I got:

Code:
<Error xmlns="urn:zimbra">
<Code>mail.INVITE_OUT_OF_DATE</Code>
<Trace>com.zimbra.cs.mailbox.MailServiceException: The specified Invite is out of date (has been updated): e8713cab-6e90-4670-b499-e8efd12862d5:206297
at com.zimbra.cs.mailbox.MailServiceException.INVITE_OUT_OF_DATE(MailServiceException.java:351)
at com.zimbra.cs.service.mail.ModifyCalendarItem.handle(ModifyCalendarItem.java:102)
at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:270)
at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:168)
at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:90)
at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:223)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
</Trace>
</Error>
Line 102 here: SourceForge.net Repository - [zimbra] View of /trunk/ZimbraServer/src/java/com/zimbra/cs/service/mail/ModifyCalendarItem.java

Says that it is probably something to do with compNum... which from my createAppointment returned:

Code:
<comp seq="0" transp="O" loc="location" fb="B" status="CONF" apptId="206297" isOrg="1" fba="B" calItemId="206297" compNum="0" rsvp="0" x_uid="25798dea-4f7f-4056-9979-b488d7003f03" name="Complete Job">
<s d="20071031T100000" tz="(GMT-05.00) Eastern Time (US &amp; Canada)"/>
0 = compnum

So what is it? What does it really mean? Help!? TIA.
Reply With Quote
  #2 (permalink)  
Old 10-15-2007, 03:59 PM
Former Zimbran
 
Posts: 5,606
Default

Hi Phingers-
Can you please post your whole CreateAppointmentRequest/Response and ModifyAppointmentRequest so that we can look at it. We think you need an InvID.
Reply With Quote
  #3 (permalink)  
Old 10-15-2007, 06:13 PM
Special Member
 
Posts: 151
Default my full soap request

Here ya go, this is based off the old soap calendar here: SourceForge.net Repository - [zimbra] View of /trunk/ZimbraServer/docs/soap-calendar.txt

I know this is out of date now... any ideas though?

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> 
<soap:Header> 
<context xmlns="urn:zimbra"> 
<authToken>valid token</authToken> 
</context> 
</soap:Header> 
<soap:Body> 
<ModifyAppointmentRequest id="206297" comp="0" xmlns="urn:zimbraMail"> 
<m d="1192496920"> 
<inv method="REQUEST" type="event" fb="B" transp="O" status="CONF" allDay="0" name="Complete Inspection - street - # 12345" loc="123 anywhere st"> 
<s tz="(GMT-05.00) Eastern Time (US &amp; Canada)" d="20071030T150000"/> 
<dur m="240"/> 
<or a="me@domain.net"/> 
</inv> 
<mp ct="multipart/alternative"> 
<mp ct="text/plain"> 
<content> 
The following is a new appointment request: Subject: Complete Inspection - street - # 12345Organizer: me@domain.net  Location: 123 anywhere st Time: 10-30-2007, 3:00 PM *~*~*~*~*~*~*~*~*~* 
</content> 
</mp> 
<mp ct="text/html"> 
<content> 
<html> 
<body> 
<h3> 
The following is a new meeting request:</h3> 
<p></p> 
<table border='0'> 
<tr> 
<th align='left'> 
Subject:</th> 
<td> 
Complete Inspection - 123 anywhere street - # 12345</td> 
</tr> 
<tr> 
<th align='left'> 
Organizer:</th> 
<td> 
me@domain.net </td> 
</tr> 
</table> 
<p></p> 
<table border='0'> 
<tr> 
<th align='left'> 
Location:</th> 
<td> 
123 anywhere street </td> 
</tr> 
<tr> 
<th align='left'> 
Date:</th> 
<td> 
10-30-2007, 3:00 PM</td> 
</tr> 
</table> 
<div> 
*~*~*~*~*~*~*~*~*~*</div> 
</body> 
</html> 
</content> 
</mp> 
</mp> 
<su>test</su> 
</m> 
</ModifyAppointmentRequest> 
</soap:Body> 
</soap:Envelope>
Reply With Quote
  #4 (permalink)  
Old 10-15-2007, 06:22 PM
Special Member
 
Posts: 151
Default soap create

This is the code for a create, different appointment, but the exact same code I use to create, the create works great. Its cancel and modify I cant get to work

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> 
<soap:Header> 
<context xmlns="urn:zimbra"> 
<authToken>valid token</authToken> 
</context> 
</soap:Header> 
<soap:Body> 
<CreateAppointmentRequest xmlns="urn:zimbraMail"> 
<m d="1192497508"> 
<inv method="REQUEST" type="event" fb="B" transp="O" status="CONF" allDay="0" name="Complete  Inspection - 123 anywhere st - # 12345" loc="123 anywhere st"> 
<s tz="(GMT-05.00) Eastern Time (US &amp; Canada)" d="20071031T100000"/> 
<dur m="75"/> 
<or a="me@domain.net"/> 
</inv> 
<mp ct="multipart/alternative"> 
<mp ct="text/plain"> 
<content> 
The following is a new appointment request: Subject: Complete  Inspection - 123 anywhere st - # 12345 Organizer: me@domain.net  Location: 123 anywhere st Time: 10-31-2007, 10:00 AM *~*~*~*~*~*~*~*~*~* 
</content> 
</mp> 
<mp ct="text/html"> 
<content> 
<html> 
<body> 
<h3> 
The following is a new meeting request:</h3> 
<p></p> 
<table border='0'> 
<tr> 
<th align='left'> 
Subject:</th> 
<td> 
Complete  Inspection - 123 anywhere st - # 12345 </td> 
</tr> 
<tr> 
<th align='left'> 
Organizer:</th> 
<td> 
me@domain.net </td> 
</tr> 
</table> 
<p></p> 
<table border='0'> 
<tr> 
<th align='left'> 
Location:</th> 
<td> 
123 anywhere st </td> 
</tr> 
<tr> 
<th align='left'> 
Date:</th> 
<td> 
10-31-2007, 10:00 AM</td> 
</tr> 
</table> 
<div> 
*~*~*~*~*~*~*~*~*~*</div> 
</body> 
</html> 
</content> 
</mp> 
</mp> 
<su>test</su> 
</m> 
</CreateAppointmentRequest> 
</soap:Body> 
</soap:Envelope>

this is the response:

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<sessionId id="26292">26292</sessionId>
<refresh>
.... lots of stuff removed here ....
</refresh>
<change token="260985"/>
<notify seq="1">
<created>
<appt d="1192497497000" uid="cbb52239-25f0-4d3a-8d55-4061c09aaa6d" l="10" s="2719" id="206893" rev="260985">
<inv type="appt" seq="0" compNum="0" id="206892">
<tz dayoff="-240" stdoff="-300" id="(GMT-05.00) Eastern Time (US &amp; Canada)">
<standard sec="0" hour="2" wkday="1" min="0" mon="11" week="1"/>
<daylight sec="0" hour="2" wkday="1" min="0" mon="3" week="2"/>
</tz>
<replies/>
<comp seq="0" transp="O" loc="123 anywhere st" fb="B" status="CONF" apptId="206893" isOrg="1" fba="B" calItemId="206893" compNum="0" rsvp="0" x_uid="cbb52239-25f0-4d3a-8d55-4061c09aaa6d" name="Complete  Inspection - 123 anywhere st - # 12345">
<s d="20071031T100000" tz="(GMT-05.00) Eastern Time (US &amp; Canada)"/>
<dur m="75"/>
<or url="me@domain.net"/>
</comp>
</inv>
</appt>
</created>
<modified>
<folder n="1520" id="10"/>
<mbx s="3231848427"/>
</modified>
</notify>
</context>
</soap:Header>
<soap:Body>
<CreateAppointmentResponse apptId="206893" calItemId="206893" invId="206893-206892" xmlns="urn:zimbraMail"/>
</soap:Body>
</soap:Envelope>
Reply With Quote
  #5 (permalink)  
Old 10-17-2007, 08:37 AM
Special Member
 
Posts: 151
Default invite out of date

So after spending sometime pouring over the actual java zimbra source code... I figured it out.

I was taking the SOAP result, and parsing out the appt and other things from a little further up the SOAP Response.

I should have been taking the invId from the actual

Code:
<ModifyAppointmentResponse apptId="206297" calItemId="206297" id="206297-207182" invId="206297-207183" xmlns="urn:zimbraMail"/>
the apptId just plain 206297 is not enough information for zimbra, it needs the secondary part -207182, for some kind of sub ID portion.

Once I started using that everthing clicked into place.

The zimbra SOAP documentation just states:

Code:
<ModifyAppointmentRequest id="INVITE_ID_OF_DEFAULT_INVITE" comp="COMPONENT_NUM_DEFAULT_INVITE">
comp is 0 since it isnt really used, and invite_id_of_default_invite, really means use the true soap response...

So I hope this helps someone else, since I'm new to SOAP, and I'm using PHP, and we know that PHP and SOAP just dont play well together yet, so somethings just need to be parsed by hand.

Thanks.
Reply With Quote
  #6 (permalink)  
Old 10-17-2007, 09:12 AM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by phingers View Post
So after spending sometime pouring over the actual java zimbra source code... I figured it out.

I was taking the SOAP result, and parsing out the appt and other things from a little further up the SOAP Response.

I should have been taking the invId from the actual

Code:
<ModifyAppointmentResponse apptId="206297" calItemId="206297" id="206297-207182" invId="206297-207183" xmlns="urn:zimbraMail"/>
the apptId just plain 206297 is not enough information for zimbra, it needs the secondary part -207182, for some kind of sub ID portion.

Once I started using that everthing clicked into place.

The zimbra SOAP documentation just states:

Code:
<ModifyAppointmentRequest id="INVITE_ID_OF_DEFAULT_INVITE" comp="COMPONENT_NUM_DEFAULT_INVITE">
comp is 0 since it isnt really used, and invite_id_of_default_invite, really means use the true soap response...

So I hope this helps someone else, since I'm new to SOAP, and I'm using PHP, and we know that PHP and SOAP just dont play well together yet, so somethings just need to be parsed by hand.

Thanks.
Good stuff. Thanks for posting this.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.