Best java API for CalDav on ZIMBRA

Questions, comments, and problems with Zimbra on Apple desktops & general CalDAV / CardDAV questions.
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Best java API for CalDav on ZIMBRA

Postby G71 » Fri Aug 19, 2016 10:13 am

this is my first topic and with a search I didn't find what I need. Sorry if the topic has been already discussed.

In brief, I'm going to develop a new application in java that has to "connect" with ZIMBRA through CalDav. What I need, is to get the appointment on the calendar, read / modify it or add a new one. Is there some java library suggested for these case. What are better API for the connection with CalDav? Obviously, I'm looking for free libs that no need of fee payment. If there aren't free libs, please give me alternative

Thank you

G71


thorx
Advanced member
Advanced member
Posts: 54
Joined: Sat Sep 13, 2014 3:26 am

Re: Best java API for CalDav on ZIMBRA

Postby thorx » Mon Aug 22, 2016 10:17 am

If you go the zimbra-soap route, you could do that and more(absolutly everything the webclient can do you can do using the zimbra soap api).
Zimbra soap is easy to use when you first get the hang of it. I have used it in powershell and python.
https://wiki.zimbra.com/wiki/SOAP_API_R ... with_ZCS_8

For getting calender you could also use rest api:
https://wiki.zimbra.com/wiki/Zimbra_REST_API_Reference


Caldav:
Havent tried programming against that yet.
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: Best java API for CalDav on ZIMBRA

Postby G71 » Fri Aug 26, 2016 1:14 pm

thorx wrote:If you go the zimbra-soap route, you could do that and more(absolutly everything the webclient can do you can do using the zimbra soap api).
Zimbra soap is easy to use when you first get the hang of it. I have used it in powershell and python.
https://wiki.zimbra.com/wiki/SOAP_API_R ... with_ZCS_8

For getting calender you could also use rest api:
https://wiki.zimbra.com/wiki/Zimbra_REST_API_Reference


Caldav:
Havent tried programming against that yet.


Hi, thanks a lot for your reply. Unfortunatelly, Zimbra REST is a not complete as functions as I want. REST API is missing for the updating/deletion of appointments and over all if you want create a new appointment, you have to use a CURL system. This not works for me.
Other side, Zimbra SOAP doesn't have WSDL and the documentation is very poor. So, I came back at the beginning. I'm going to test various java libs that have CalDav as protocoll. At the moment, I tried Milton but its maven repository is empty... :-)


It's a hard work... ;-)
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: Best java API for CalDav on ZIMBRA

Postby G71 » Mon Aug 29, 2016 9:21 am

G71 wrote:
thorx wrote:If you go the zimbra-soap route, you could do that and more(absolutly everything the webclient can do you can do using the zimbra soap api).
Zimbra soap is easy to use when you first get the hang of it. I have used it in powershell and python.
https://wiki.zimbra.com/wiki/SOAP_API_R ... with_ZCS_8

For getting calender you could also use rest api:
https://wiki.zimbra.com/wiki/Zimbra_REST_API_Reference


Caldav:
Havent tried programming against that yet.


Hi, thanks a lot for your reply. Unfortunatelly, Zimbra REST is a not complete as functions as I want. REST API is missing for the updating/deletion of appointments and over all if you want create a new appointment, you have to use a CURL system. This not works for me.
Other side, Zimbra SOAP doesn't have WSDL and the documentation is very poor. So, I came back at the beginning. I'm going to test various java libs that have CalDav as protocoll. At the moment, I tried Milton but its maven repository is empty... :-)


It's a hard work... ;-)


Just an upgrade. Milton is a Server Lib. not a client library. So, don't works for me.
User avatar
Gren Elliot
Zimbra Employee
Zimbra Employee
Posts: 183
Joined: Tue Jun 10, 2014 4:45 am

Re: Best java API for CalDav on ZIMBRA

Postby Gren Elliot » Mon Aug 29, 2016 8:27 pm

Other side, Zimbra SOAP doesn't have WSDL


Just FYI - the Zimbra SOAP API does have WSDL. See https://wiki.zimbra.com/wiki/Wsdl

The Zimbra Web Client uses the SOAP API, so one approach which might work for you would be to monitor web traffic whilst that does things that you want to do and see how it is achieved.
thorx
Advanced member
Advanced member
Posts: 54
Joined: Sat Sep 13, 2014 3:26 am

Re: Best java API for CalDav on ZIMBRA

Postby thorx » Tue Aug 30, 2016 1:23 pm

Strange, I find the zimbra soap documentation very good. what's missing in the documentation? I have always managed to follow that documentation. Have only encountered 1-2 errors in the doc. like it says seconds and it's milliseconds. Reported those to bugzilla so think they are fixed.

As Gren Elliot says you can also use the webclient to get what soap queries needed for a task.
I use sometimes the debug/dev mode and just click in the webclient, the soap commands are revealed in the debug window.
https://wiki.zimbra.com/wiki/Web_Client_URL_Tricks
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: Best java API for CalDav on ZIMBRA

Postby G71 » Tue Aug 30, 2016 1:58 pm

Gren Elliot wrote:
Other side, Zimbra SOAP doesn't have WSDL


Just FYI - the Zimbra SOAP API does have WSDL. See https://wiki.zimbra.com/wiki/Wsdl

The Zimbra Web Client uses the SOAP API, so one approach which might work for you would be to monitor web traffic whilst that does things that you want to do and see how it is achieved.


Thanks Gren Elliot. I found it. I built the client with axis2 (1.5.3) (with last version 1.7.3 doesn't works but at the moment I don't care about it)


thorx wrote:Strange, I find the zimbra soap documentation very good. what's missing in the documentation? I have always managed to follow that documentation. Have only encountered 1-2 errors in the doc. like it says seconds and it's milliseconds. Reported those to bugzilla so think they are fixed.

As Gren Elliot says you can also use the webclient to get what soap queries needed for a task.
I use sometimes the debug/dev mode and just click in the webclient, the soap commands are revealed in the debug window.
https://wiki.zimbra.com/wiki/Web_Client_URL_Tricks


Probably I'm not explained me very well. I meant that I didn't find examples in order to build a fast SOAP Zimbra client. Sorry, but I'm new of this product and probably these examples are in some place that I don't know

What I need is to connect to a Zimbra server and read from it, calendar appointments about an user xyz. Add/modify/delete another appointment into the calendar of the user xyz

For me it's enough a point to start.

Thanks a lot

G71
thorx
Advanced member
Advanced member
Posts: 54
Joined: Sat Sep 13, 2014 3:26 am

Re: Best java API for CalDav on ZIMBRA

Postby thorx » Tue Aug 30, 2016 4:43 pm

yeah I can agree on the examples bit.
I use zimbra soap in powershell(and python) just using normal http_request(https://technet.microsoft.com/en-us/lib ... 49971.aspx). no spescial client just xml formatted http request.
First I send an authrequest to get an authtoken. when you got the authtoken you can use this to form a soap query to run everything the webclient can do. and that's a lot :)

if you got an authtoken from an admin user, you can even impersonate any user in the soap requests.

I use different auth request if it's admin auth or normal auth.
Admin:

Code: Select all

         
            $xmlns = "urn:zimbraAdmin"
            $request = '<AuthRequest xmlns="'urn:zimbraAdmin'" name="' + $account + '" password="' + $password + '">'
            $request += '</AuthRequest>'
            
            "<soap:Envelope xmlns:soap=`"http://www.w3.org/2003/05/soap-envelope`">" +
               "<soap:Header>" +
                  "<context xmlns=`"urn:zimbra`">" +
                  "</context>" +
               "</soap:Header>" + 
               "<soap:Body>" + $request  + "</soap:Body>" +
            "</soap:Envelope>"         


Normal user:

Code: Select all

            $xmlns = "urn:zimbraAccount"
            $request = '<AuthRequest xmlns="'+$xmlns+'">'
            $request += ' <account by="name">' + $account + '</account>'
            $request += ' <password>' + $password + '</password>'            
            $request += '</AuthRequest>'

            "<soap:Envelope xmlns:soap=`"http://www.w3.org/2003/05/soap-envelope`">" +
               "<soap:Header>" +
                  "<context xmlns=`"urn:zimbra`">" +
                  "</context>" +
               "</soap:Header>" + 
               "<soap:Body>" + $request  + "</soap:Body>" +
            "</soap:Envelope>"


A soap query can look like this:

Code: Select all

            "<soap:Envelope xmlns:soap=`"http://www.w3.org/2003/05/soap-envelope`">" +
               "<soap:Header>" +
                  "<context xmlns=`"urn:zimbra`">" +
                     <authToken>insert authtoken you got from the auth soap query here</authToken>
                      <account by="name">if your admin you can impersonate any user spesified here</account>
                  "</context>" +
               "</soap:Header>" + 
               "<soap:Body>" + Soap query here + "</soap:Body>" +
            "</soap:Envelope>"


Then to get into what queries needed just use webclient with dev/debug mode and click in the webclient to get a hint on what queries the webclient uses to achive what you want.
Then use soap api documentation to understand what's going on :
https://wiki.zimbra.com/wiki/SOAP_API_R ... with_ZCS_8

Does this help? code above is from my powershell code.
thorx
Advanced member
Advanced member
Posts: 54
Joined: Sat Sep 13, 2014 3:26 am

Re: Best java API for CalDav on ZIMBRA

Postby thorx » Tue Sep 13, 2016 8:30 am

Did you get it working?
richa
Posts: 1
Joined: Tue May 29, 2018 9:04 am

Re: Best java API for CalDav on ZIMBRA

Postby richa » Tue May 29, 2018 10:46 am

Hi ,

I am also working on same kind of functionality. My Question is how can we retrieve Task(getTask) list from Zimbra using SOAP API in PHP.
Is there any way to generate request and response for the same.
Can anyone suggest plz.

Thanks.

Return to “CalDAV / CardDAV / iSync”

Who is online

Users browsing this forum: No registered users and 0 guests