Delete a calendar appointment via SOAP

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
kkuilla
Posts: 2
Joined: Fri Sep 12, 2014 11:59 pm

Delete a calendar appointment via SOAP

Postby kkuilla » Wed Jan 14, 2009 6:18 am

Dear all,
I am trying to add and delete Zimbra calendar events via SOAP and PHP. I have ten different users and I try to automatically create and delete events in their calendar. I have solved the authentication and have managed to post events but I can't delete them.
To get an idea of what the delete message should look like, I delete an appointment manually and then observer the browser console for a delete soap message. I then investigated the soap message and copied and pasted what I thought was relevant.
This is the soap message for creating an event:
Request:

 
ENV=http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraMail"

xmlns:ns2="urn:zimbra">

0_ed0dafcfaa3f5497d3d5a29bae35aba7b18d5afc_69643d33363a63343064383963312d383839332d343933652d613738622d6562313161326666643638393b6578703d31333a313233313933373831323730393b6169643d33363a37303335353137332d666464312d343533652d383832362d3933633330666165623034613b747970653d363a7a696d6272613b




status="CONF" fb="B" class="PUB" transp="O" allDay="0" name="1" loc="316">
tz="(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon / London"

d="20090113T150000"/>
Lisbon / London" d="20090113T153000"/>
action="DISPLAY">

Dont know what this is for
ct="text/plain" ><html><

body></body></html>





And this is the response:
http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope

/">1598

5.0.11_GA_2695.UBUNTU8 20081117052520 20081117-0527

FOSS
s="0" id="1" rev="1">
id="16" rev="1"/>
s="42216" id="10" rev="1"/>
id="14" rev="1"/>
rev="1"/>




view="message" n="0" l="1" name="Junk" s="0" id="4" rev="1"/>
n="0" l="1" name="Notebook" s="0" id="12" rev="1"/>
l="1" name="Sent" s="0" id="5" rev="1"/>
name="Tasks" s="0" id="15" rev="1"/>
id="3" rev="1"/>


s="2479" id="675" rev="1102">
dayoff="60" stdoff="0" id="(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon /

London">


d="1231934212000" class="PUB" loc="316" transp="O" seq="0" uid="933f732c-

dbf6-44d8-b5b8-b6ffeb5a8bd7" fb="B" status="CONF" fba="T" apptId="675"

calItemId="675" compNum="0" rsvp="1" x_uid="933f732c-dbf6-44d8-b5b8-b6ffeb5a8bd7"

name="1">


d="20090113T150000" tz="(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon /

London"/>
Edinburgh / Lisbon / London"/>






calItemId="675" invId="675-674" xmlns="urn:zimbraMail"/>




Unfortunately, I get a soap error for my delete message. Does anyone know where I go wrong?
This is the soap message I managed to compose for deleting an appointment, after watching the browser console:
Request:
 
ENV=http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraAdmin"

xmlns:ns2="urn:zimbra">

0_a49beecd5e64004a79113e85ef690bcf8f8b5967_69643d33363a63343064383963312d383839332d343933652d613738622d6562313161326666643638393b6578703d31333a313233313933383238383338373b6169643d33363a37303335353137332d666464312d343533652d383832362d3933633330666165623034613b747970653d363a7a696d6272613b



xmlns="urn:zimbraMail" id="abs1" comp="0">
xmlns="">Cancelled: 9

<html><body>&

lt;/body></html>



And this is the response:
http://www.w3.org/2003/05/soap-envelope">

soap:Receiver

system failure:

com.zimbra.common.soap.Element$ContainerException: cannot set text on element with

children

service.FAILURE

btpool0-7:1231934688553:7d35dd8954845b2f




Thanks,

Rgds /Sam


jholder
Zimbra Employee
Zimbra Employee
Posts: 4686
Joined: Fri Sep 12, 2014 10:00 pm

Delete a calendar appointment via SOAP

Postby jholder » Wed Jan 14, 2009 9:51 am

Hello, and welcome Sam!
I see two problems with your SOAP request.
Your request is:

 

http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraAdmin" xmlns:ns2="urn:zimbra">





0_a49beecd5e64004a79113e85ef690bcf8f8b5967_69643d33363a63343064383963312d383839332d343933652d613738622d6562313161326666643638393b6578703d31333a313233313933383238383338373b6169643d33363a37303335353137332d666464312d343533652d383832362d3933633330666165623034613b747970653d363a7a696d6272613b







xmlns="urn:zimbraMail" id="abs1" comp="0">



Cancelled: 9











</body>










Problem one is that xmlns="urn:zimbraMail" isn't properly formatted. It should be:


The second issue is that you introduce a body tag, but the closing tag is encoded:

</body>

should be:


Good luck,

john
kkuilla
Posts: 2
Joined: Fri Sep 12, 2014 11:59 pm

Delete a calendar appointment via SOAP

Postby kkuilla » Tue Jan 20, 2009 5:22 am

Thanks for your reply. Very helpful. However, after making changes I still get an error, "Unknown document". What does this unknown document refer to? Is it the SOAP document or the appointment I am trying to access? I first thought that I used the wrong appointment ID but the id appeared to be correct. I can't figure out why I get the error. Do you have any idea?
I still look in the console of the browser to get an idea of what the SOAP message should look like and adjust it to what I think would fit. This is what I came up with:
This is my request:


http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope/"

xmlns:ns1="urn:zimbraAdmin" xmlns:ns2="urn:zimbra">



0_abe599b1fbc30df702316cf6eb975432bdb6ded2_69643d33363a34633862343764612d326533312d343031622d386235372d3633313333643633653434363b6578703d31333a313233323435313130383635313b6169643d33363a37303335353137332d666464312d343533652d383832362d3933633330666165623034613b747970653d363a7a696d6272613b




id="abs1" comp="0">Cancelled: kclies
ct="multipart/alternative">
ct="text/html">
>



And this is the response:
http://schemas.xmlsoap.org/soap/envelope">http://schemas.xmlsoap.org/soap/envelope">



soap:Client

unknown document: ns1:CancelAppointmentRequest



Code>service.UNKNOWN_DOCUMENT

btpool0-13:1232447544387:7d35dd8954845b2f




Thanks,

Rgds /Sam
jholder
Zimbra Employee
Zimbra Employee
Posts: 4686
Joined: Fri Sep 12, 2014 10:00 pm

Delete a calendar appointment via SOAP

Postby jholder » Fri Jan 23, 2009 12:01 pm

This might be helpful.

soap-calendar1.txt

Michael REMY
Advanced member
Advanced member
Posts: 91
Joined: Sat Sep 13, 2014 12:31 am

Delete a calendar appointment via SOAP

Postby Michael REMY » Mon Apr 26, 2010 8:17 am

hi kkuilla !
did you success in solving your problem ?
Shall you publish your solution to create and delete an appointment please ?
It should be very pretty helpful for the community.
Thanks by advance
Michael REMY
Advanced member
Advanced member
Posts: 91
Joined: Sat Sep 13, 2014 12:31 am

Delete a calendar appointment via SOAP

Postby Michael REMY » Wed Apr 28, 2010 5:07 am

[quote user="jholder"]This might be helpful.[/QUOTE]
hi !
i have exactly the same problem and i follow the doc you provided. It says :

[QUOTE]//////////////////////////////////////////////////////////////////////

//

// CancelAppointment(DEFAULT-INVITE-ID, COMPONENT-NUMBER)

//

// NOTE: If canceling an exception, the original instance (ie the one the exception was "excepting") WILL NOT

// be restored when you cancel this exception.

//

// if is set, then this cancels just the specified instance or range of instances,

// otherwise it cancels the entire appointment. If is not set, then id MUST refer to the default

// invite for the appointment.

//



[] // definition for TZID referenced by DATETIME in

[]?

[

[*] // users to send update to

[{subject of cancellation mail}]

...

]

[/QUOTE]
And the response is :
[QUOTE]....
[/QUOTE]
oh my god, the documentation is incompleted for the CancelAppointmentResponse detail.


Should an expert help us ?
here the req i send :




Annulation: un nom<html><body><html><body></body></html></body></html>


and here is the respond i get :

[QUOTE]Array

(

[SOAP:FAULT] => Array

(

[SOAP:CODE] => Array

(

[SOAP:VALUE] => Array

(

[DATA] => soap:Sender

)
)
[SOAP:REASON] => Array

(

[SOAP:TEXT] => Array

(

[DATA] => unknown document: CancelAppointmentRequest

)
)
[SOAP:DETAIL] => Array

(

[ERROR] => Array

(

[XMLNS] => urn:zimbra

 => Array

(

[DATA] => service.UNKNOWN_DOCUMENT

)
[TRACE] => Array

(

[DATA] => btpool0-37998:http://77.246.84.130:80/service/soap:1272448885411:01b1f7311b8ec6f6

)
)
)
)
)

[/QUOTE]


so, where is the problem ?

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests