Wiki source code of ERGroupware

Version 24.1 by Pascal Robert on 2012/09/16 18:51

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