Wiki source code of ERGroupware
Version 35.1 by Pascal Robert on 2012/09/16 19:01
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Actions = | ||
2 | |||
3 | |= Action name |= CalDAV |= MS Exchange |= Zimbra (SOAP) | ||
4 | | Connecting to the store | CalDavCalendarStore calendarStore = new CalDavCalendarStore("~/~/MacTI/MKS2Exchange", new URL("http:~/~/192.168.200.144"), PathResolver.KMS); | ||
5 | \\calendarStore.connect("cpeltier", "migration".toCharArray()); | ||
6 | | ExchangeAuthenticator authenticator = new ExchangeAuthenticator("**DOMAIN | ||
7 | \\ | ||
8 | \\probert//aircourriel//**//", "**Migration12**".toCharArray()); | ||
9 | \\Authenticator.setDefault(authenticator); | ||
10 | \\ExchangeWebService service = new ExchangeWebService(new java.net.URL("[[file:/Users/probert/Documents/OACIQ/Services.wsdl.xml>>file:UsersprobertDocumentsOACIQServices.wsdl.xml*]]"), new QName("http:~/~/schemas.microsoft.com/exchange/services/2006/messages", "ExchangeWebService")); | ||
11 | \\ExchangeServicePortType port = service.getExchangeWebPort(); | ||
12 | \\((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME//PROPERTY, "**probert//aircourriel//**//"); | ||
13 | \\((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD//PROPERTY, "**Migration12**"); | ||
14 | \\MailboxCultureType culture = new MailboxCultureType(); | ||
15 | \\culture.setValue("en-US"); | ||
16 | \\RequestServerVersion serverVersion = new RequestServerVersion(); | ||
17 | \\serverVersion.setVersion(ExchangeVersionType.EXCHANGE//2010//SP//1); | ||
18 | \\TimeZoneDefinitionType tzType = new TimeZoneDefinitionType(); | ||
19 | \\tzType.setId("**Eastern Standard Time**"); | ||
20 | \\TimeZoneContextType tzContext = new TimeZoneContextType(); | ||
21 | \\tzContext.setTimeZoneDefinition(tzType); | ||
22 | \\Holder<CreateItemResponseType> responseHolder = new Holder<CreateItemResponseType>(new CreateItemResponseType()); | ||
23 | \\ExchangeImpersonationType impersonation = new ExchangeImpersonationType(); | ||
24 | \\ConnectingSIDType sid = new ConnectingSIDType(); | ||
25 | \\sid.setPrimarySmtpAddress("**probert@aircourriel.com**"); | ||
26 | \\impersonation.setConnectingSID(sid); // | ||
27 | | URL url = new URL("**http**", "**192.168.3.10**", **1**, "/"); | ||
28 | \\ZMailbox.Options options = new ZMailbox.Options(); | ||
29 | \\options.setAccount("**admin**"); | ||
30 | \\options.setAccountBy(AccountBy.name); | ||
31 | \\options.setPassword("**conatus**"); | ||
32 | \\options.setUri(resolveUrl(url.getProtocol() + ":~/~/" + url.getHost(), false)); | ||
33 | \\ZMailbox utils = ZMailbox.getMailbox(options); | ||
34 | \\HttpState initialState = new HttpState(); | ||
35 | \\Cookie mycookie = new Cookie(url.getHost(), "ZM//AUTH//TOKEN", utils.getAuthToken().getValue(), "/", null, false); | ||
36 | \\initialState.addCookie(mycookie); |