title: Printing the body of a message
body: <p>I am trying to make a program that will neatly print all the bodies of the messages of my inbox yet exchange web services is making it difficult.  I seem to have easy access to everything except the body of the message.  This is what I'm doing right now</p>
  
  <pre><code>static final int SIZE = 10;
  public static void main(String [] args) throws Exception {
  ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
  
  ExchangeCredentials credentials = new WebCredentials("USERNAME","PASS");
  service.setCredentials(credentials);
  service.setUrl(new URI("https://MY_DOMAIN/ews/exchange.asmx"));
  
  ItemView view = new ItemView (SIZE);
  FindItemsResults&lt;Item&gt; findResults = service.findItems(WellKnownFolderName.Inbox, view);
  System.out.println(findResults.getItems().size() + "Messages");
  
  
  for (int i = 0; i &lt; SIZE; ++i) {
      try {
          Item item = findResults.getItems().get(i);
      System.out.println("SUBJECT: " + item.getSubject());
      System.out.println("TO: " + item.getDisplayTo());
      System.out.println("BODY: " + item.getBody().toString());
  
  
      } catch (IndexOutOfBoundsException e) {
          break;
      }
  
  
  }
  </code></pre>
  
  <p>Of course, I have my credentials and domain filled out fittingly for my code.  When I run this I get this message though.</p>
  
  <pre><code>Exception in thread "main" microsoft.exchange.webservices.data.ServiceObjectPropertyException: You must load or assign this property before you can read its value.
      at microsoft.exchange.webservices.data.PropertyBag.getPropertyValueOrException(Unknown Source)
      at microsoft.exchange.webservices.data.PropertyBag.getObjectFromPropertyDefinition(Unknown Source)
      at microsoft.exchange.webservices.data.Item.getBody(Unknown Source)
      at Main.main(Main.java:26)
  </code></pre>
  
  <p>Line 26 is the line where I try to print the body. What am I doing wrong?</p>