First Look to EWS

Since 1998 the first contact I got with Microsoft Exchange and Unified Messaging I know Frank Carius Website and it was the prefered second place after the MSDN or Microsoft Knowledge and MS Support  Site  to look at and to start looking for getting news and hints for some Exchange problems. Also I got good hints or deeper information when I started in developing smal Workflowsolutions for Outlook and Exchange 5.5.

So till now I can advise anyone how is interested into Exchange to start with look here. Also for the Exchange Web Services:

Exchange Developement




User authentication seems to be ok... web service methods calls throw the exception above... whats wrong? any suggestions? thx


nestoru wrote  Mar 3 2011 at 6:41 PM 


Here are some suggestions:

1. Opening an official project with bug tracking etc. This is the second file that I see with the same version number. Version tracking is important.
2. Fixing the ant script so it actually works. People can then generate a jar file and then later include it in their projects no matter if they use Eclipse, Netbeans etc.
3. Mavenizing the project should be the best to do in my opinion. That will keep installation instructions straightforward and seamless integration in existing projects === more agile.

For those looking for a free open source alternative (and already tested Java API) you can checkout the code based on JAX-WS from A discussion about the EWS SOAP API including the history about why I picked JAX-WS can be reached at

Thanks for the work on this managed API



EWS Tracing


Example to enable Tracing EWS:


                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                //enable tracing
                ITraceListener myTracer = null;
                //myTracer.trace(arg0, arg1);
                service.setTraceEnabled(bTraceit); //TRACE ACTIVIEREN   


If no flags are set all flags will be traced!


Useful hints can be found also here:


Example CLASS to use Trace with XML in JAVA



//  Converted code from C# to JAVA

//  Code written by NNellen 2013/2014



import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;

import org.w3c.dom.Document;

public class MyTraceListener implements ITraceListener {
    public void trace(String traceType, String traceMessage)
        CreateXMLTextFile(traceType, traceMessage.toString());
    private void CreateXMLTextFile(String fileName, String traceContent)
        // Create a new XML file for the trace information.
            Document xmlDoc  = DocumentBuilderFactory.newInstance()
            //Element myRootElement = xmlDoc.createElement("myroot");
                    new DOMSource(xmlDoc), new StreamResult(fileName + ".xml"));
        catch (Exception e)
            OwnLib myLib= new OwnLib();
            // If the trace data is not valid XML, save it as a text document.
            myLib.debuglog(fileName + ".txt", traceContent);
    public Document loadXMLFromString(String xml) throws Exception
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

        DocumentBuilder builder = factory.newDocumentBuilder();

        return builder.parse(new ByteArrayInputStream(xml.getBytes()));