| 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.
|  | | 
06-30-2008, 05:39 AM
| | | Funny, we have two french developers chatting on an english forum 8)
In order to get the last and updated documentations about SOAP and APIs, you have to do a code checkout (against P4).
The up-to-date files are here (and here only, yet). | 
07-20-2008, 04:11 AM
| | | hey Nobfin and Merinew
This post really helped solve my doubts....just 1 query....what port number are you people using?
7071 is for admin console I guess........
What is the port number for other request of users? | 
07-21-2008, 01:06 AM
| | | Hi Shikha Sood,
The SOAP port is the same as the Web console : 80
Klug : Yes, I had not noticed that !  | 
07-21-2008, 05:47 AM
| | | Thanks again  | 
10-08-2008, 02:21 AM
| | | getting started ... I have just started to discover Zimbra. I have the same deal : to build j2ee application tha will use zimbra as calendar.
Before to be able to run these codes, what are the firts steps to do ?
1/ install ZCS 5.0 ?
2/build a dev environment with eclipse and get source code from Sourceforge ?
...
Best regards for Marinew and nbobfin. | 
10-08-2008, 02:24 AM
| | | Hello Marina,
I am beginner in Zimbra and i have the same deal : to developp a j2ee software to use Zimbra as calendar.
Before use your source code, what are the first steps to do : install ZCS 5, 2/ build a dev env with eclipse and get source codes from Sourceforge ,...
Best regards for your help | 
10-08-2008, 03:03 AM
| | | Hi eheb,
Yes, you'll first have to install ZCS on a server, and make sure that it works correctly.
Then, in your J2EE app, in Eclipse for example, you'll have to add some of the Zimbra libraries in the project that will communicate with Zimbra through webservices.
Personally, I included the following libraries in my project.
- zimbracommon.jar
- zimbrastore.jar
I found them on ZCS server that I deployed before.
Marine | 
10-08-2008, 03:14 AM
| | | Quote:
Originally Posted by marinew Hi nbobfin,
Yes, I succeeded calling Zimbra webServices. I d'ont know whether it's the best way or not, but here is an example : Code: String serverUrl = "http://zimbraServer" + ZimbraServlet.USER_SERVICE_URI;
LmcSession session;
LmcAuthRequest auth = new LmcAuthRequest();
auth.setUsername(username);
auth.setPassword(password);
LmcAuthResponse authResp = null;
try {
authResp = (LmcAuthResponse) auth.invoke(serverURL);
} catch (Exception e) {
(...)
}
session = authResp.getSession();
LmcFolderActionRequest req = new LmcFolderActionRequest();
req.setSession(session);
req.setFolderList(listeIdFolders);
req.setOp(MailConstants.E_GRANT);
req.setGrant(droits, typeAccedant, nomAccedant);
try {
req.invoke(serverUrl);
} catch (Exception e) {
(...)
} You have to include zimbracommon.jar and zimbrastore.jar
Look into these libraries, you will find LmcFolderActionRequest class, and other classes you can use.
If there is no LmcXxxxRequest class for the service you want to invoke (LmcApptSummariesRequest, for example), you will have to write it on your own.
For this, you will have to look at the soap*.txt doc (found in Zimbra sources).
Here is an example of ApptSummariesRequest I wrote : Code: public class ApptSummariesRequest extends LmcSoapRequest {
private final static Log log = LogFactory.getLog(ApptSummariesRequest.class);
String idFolder;
Date debutRecherche;
Date finRecherche;
protected Element getRequestXML() {
Element request = DocumentHelper.createElement(MailConstants.GET_APPT_SUMMARIES_REQUEST);
// add all the attributes of the SearchRequest element
addAttrNotNull(request, com.zimbra.common.soap.MailConstants.A_CAL_START_TIME, ZimbraUtils.getFormatDateTimeMSec(debutRecherche));
addAttrNotNull(request, com.zimbra.common.soap.MailConstants.A_CAL_END_TIME, ZimbraUtils.getFormatDateTimeMSec(finRecherche));
addAttrNotNull(request, com.zimbra.common.soap.MailConstants.A_FOLDER, idFolder);
log.debug("Recherche planning entre " + debutRecherche + " et " + finRecherche + " pour idFolder=" + idFolder);
log.debug("Requete :" + DomUtil.toString(request, false));
return request;
}
protected void parseResponse(ApptSummariesResponse response, Element responseXML)
throws ServiceException, LmcSoapClientException {
log.debug("Reponse :" + DomUtil.toString(responseXML, false));
// On boucle sur les elements trouves
Collection<Appointment> apptsTrouves = new ArrayList<Appointment>();
for (Iterator<Element> it = responseXML.elementIterator(); it.hasNext();) {
Element e = (Element) it.next();
Appointment app = ResponseParser.parseAppointment(e);
apptsTrouves.add(app);
}
response.setApptTrouves(apptsTrouves);
}
protected LmcSoapResponse parseResponseXML(Element responseXML)
throws ServiceException, LmcSoapClientException {
ApptSummariesResponse response = new ApptSummariesResponse();
parseResponse(response, responseXML);
return response;
}
public String getIdFolder() {
return idFolder;
}
public void setIdFolder(String idFolder) {
this.idFolder = idFolder;
}
public Date getDebutRecherche() {
return debutRecherche;
}
public void setDebutRecherche(Date debutRecherche) {
this.debutRecherche = debutRecherche;
}
public Date getFinRecherche() {
return finRecherche;
}
public void setFinRecherche(Date finRecherche) {
this.finRecherche = finRecherche;
}
} And ApptSummariesResponse : Code: public class ApptSummariesResponse extends LmcSoapResponse {
Collection<Appointment> apptTrouves;
public Collection<Appointment> getApptTrouves() {
return apptTrouves;
}
public void setApptTrouves(Collection<Appointment> apptTrouves) {
this.apptTrouves = apptTrouves;
}
} Marine | I find this code very interesting. Can you tell me how did you implement Appointment class?
Where can i find in soap.txt Appointment properties? | 
10-08-2008, 03:28 AM
| | | Quote:
Originally Posted by marinew Hi eheb,
Yes, you'll first have to install ZCS on a server, and make sure that it works correctly.
Then, in your J2EE app, in Eclipse for example, you'll have to add some of the Zimbra libraries in the project that will communicate with Zimbra through webservices.
Personally, I included the following libraries in my project.
- zimbracommon.jar
- zimbrastore.jar
I found them on ZCS server that I deployed before.
Marine | A question about our location : i leave in Bretagne at Rennes. And you ?  | 
10-08-2008, 03:42 AM
| | | To eheb : je suis dans le Sud Finistère, au bout du monde To gambo : SOAP doc about appointments is in "soap-calendar.txt" file.
Here is my "Appointment" class : Code: public class Appointment {
private String id;
private String inviteId;
private Date dateHeureDebut;
private Date dateHeureFin;
private boolean journeeEntiere;
private String libelle;
private String lieu;
private String freeBusy;
private Collection<String> tagsId;
public Appointment() {
super();
}
public Appointment(Date dateHeureDebutRdv, Date dateHeureFinRdv,
String libelleRdv) {
super();
this.dateHeureDebut = dateHeureDebutRdv;
this.dateHeureFin = dateHeureFinRdv;
this.libelle = libelleRdv;
}
(...) getters and setters
} | | Thread Tools | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |