none
How can i find out the exchangeserver-version or how to retrive the html-body from an appointment? RRS feed

  • Question

  • A few months ago i created an Appointment-Export from our application to Exchange with EWS (the proxy classes). We use an HTML-Editor-Control in our application for the body of the appointment, so the user can format the text.

     

    Unfortunately most of the HTML-Editor-controls on the market are using XHTML. As I created my export, I used Outlook 2007 and Exchange 2007 SP1 to test. I discover, that Exchange or/and Outlook don’t understand XHTML. Especially the font-type was a problem.

    So I created a little HTML-converter, which converts the XHTML-body of the appointments of our application to this HTML, which Exchange and Outlook can understand.

     

    Now I have here a Exchange 2010, and I discover, that the HTML-body of Exchange 2007 and Exchange 2010 are different. I export the same appointment to Exchange 2007 and 2010. On 2007 the body was ok, but on 2010 all formatting is gone or is not shown.

     

    The funny thing is, that when I open this appointment from Exchange 2010 with OWA, OWA shows the correct formatting. Only Outlook can’t show it.

     

    So now i have a big problem, because I don’t know, how to manage that. I can extend my HTML-converter, so it can convert to Exchange 2010 too. But how will the application know, with which exchange-server-version it communicates?

    Or is there a better way to solve this problem?

     

    This is really  stupid, because our customers make appointments with very nice formatted invitation texts in the body, so the need the correct formatting.

    Tuesday, October 11, 2011 8:24 AM

Answers

  • Hi,

    the EWS Manged API is just a wrapper around EWS itself - so there is no information in the managed api which you can't get from EWS.

    Here is a trace of an EWS response. The server info value is in the SOAP header:

     <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
         <s:Header>
             <h:ServerVersionInfo MajorVersion="14" MinorVersion="1"
    MajorBuildNumber="225" MinorBuildNumber="71" Version="Exchange2010_SP2"
                         xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
         </s:Header>

    When I generate a proxy class (legacy .NET 2.0 webservice reference), the ExchangeServiceBinding has a property called ServerVersionInfoValue which contains the server version after the first request is made.

    Kind regards,
    Henning

    If you get your question answered, please come back and mark the reply as an answer.
    If you are helped by an answer to someone else's question, please mark it as helpful.

    • Marked as answer by GambaJo Wednesday, October 12, 2011 7:54 AM
    Wednesday, October 12, 2011 7:20 AM

All replies

  • Hi,

    I'm not sure about the formatting. But the Exchange WebService returns the Exchange Server version in each response.

    If you are using the EWS Managed API, this info is exposed through the ExchangeService.ServerInfo property.

    http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservicebase.serverinfo(v=exchg.80).aspx

    Kind regards,
    Henning

    If you get your question answered, please come back and mark the reply as an answer.
    If you are helped by an answer to someone else's question, please mark it as helpful.

    Tuesday, October 11, 2011 5:01 PM
  • Because of the formatting I read that exchange stores the body as rtf, because of the compatibility to outlook. So there must be a converter, which converts from html to rtf and back in exchange.

    I tried that. First I made an appointment in our application, send it to exchange 2007 and retrieve it. Then I made the same, but with exchange 2010. There are differences between the html-code of exchange 2007 and 2010.

    So this is very bad for me, because every time a new version of exchange or a service pack is released, I have to check the code and enlarge my html-converter.

     

    It would be nice, if Microsoft can post the differences somewhere. So it will be easier to write an converter.

     

    I found the ServerInfo-Property too. But unfortunately I have to use the proxy classes (not the API), because I can’t use FW higher than 2.0 and VS2005.

    And I checked the proxy classes for the responses. There is no such property in the proxy classes.

     

    Very unsatisfactory.

    Wednesday, October 12, 2011 6:44 AM
  • Hi,

    the EWS Manged API is just a wrapper around EWS itself - so there is no information in the managed api which you can't get from EWS.

    Here is a trace of an EWS response. The server info value is in the SOAP header:

     <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
         <s:Header>
             <h:ServerVersionInfo MajorVersion="14" MinorVersion="1"
    MajorBuildNumber="225" MinorBuildNumber="71" Version="Exchange2010_SP2"
                         xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
         </s:Header>

    When I generate a proxy class (legacy .NET 2.0 webservice reference), the ExchangeServiceBinding has a property called ServerVersionInfoValue which contains the server version after the first request is made.

    Kind regards,
    Henning

    If you get your question answered, please come back and mark the reply as an answer.
    If you are helped by an answer to someone else's question, please mark it as helpful.

    • Marked as answer by GambaJo Wednesday, October 12, 2011 7:54 AM
    Wednesday, October 12, 2011 7:20 AM
  • Ah, ok. I tried, and you are right.
    Wednesday, October 12, 2011 7:54 AM