Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JWebServices for Exchange
>
Tutorial
> Create post
The following example shows you how to create a post.
import com.independentsoft.exchange.Body; import com.independentsoft.exchange.ItemId; import com.independentsoft.exchange.Post; import com.independentsoft.exchange.Service; import com.independentsoft.exchange.ServiceException; import com.independentsoft.exchange.StandardFolder; public class Example { public static void main(String[] args) { try { Service service = new Service("https://myserver/ews/Exchange.asmx", "username", "password"); Post post = new Post(); post.setSubject("Test"); post.setBody(new Body("Body text")); ItemId itemId = service.createItem(post, StandardFolder.DRAFTS); } catch (ServiceException e) { System.out.println(e.getMessage()); System.out.println(e.getXmlMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*