Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JWebServices for Exchange
>
Tutorial
> Add category
The following example shows you how to add new appointment category.
import com.independentsoft.exchange.Category; import com.independentsoft.exchange.CategoryColor; import com.independentsoft.exchange.CategoryList; import com.independentsoft.exchange.KeyboardShortcut; import com.independentsoft.exchange.RequestServerVersion; import com.independentsoft.exchange.Service; import com.independentsoft.exchange.ServiceException; public class Example { public static void main(String[] args) { try { Service service = new Service("https://myserver/ews/Exchange.asmx", "username", "password"); service.setRequestServerVersion(RequestServerVersion.EXCHANGE_2010_SP1); CategoryList list = service.getCategoryList(); Category myCategory = new Category("Steel Category", CategoryColor.DARK_STEEL, KeyboardShortcut.CTRL_F7); myCategory.setGuid("{fac7e643-c161-4f81-b394-898943335ad4}"); list.getCategories().add(myCategory); service.updateCategoryList(list); } catch (ServiceException e) { System.out.println(e.getMessage()); System.out.println(e.getXmlMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*