[E2007] [EWS] [C#] Internal Server Error on Item.Update() RRS feed

  • Question

  • I'm using the EWS API in C# with an onsite Exchange 2007 SP1 Server. I'm using the following code to tag a message using a custom property definition. 

    //Bind to the message in question, which works fine. 
    Item m = Item.Bind(service, new ItemId(itemid));
    //Define the extended property definition. 
    ExtendedPropertyDefinition def = new ExtendedPropertyDefinition(MyGUID, "my-tag-name" MapiPropertyType.String);
    //Set the extended property to our tag which is a string 
    m.SetExtendedProperty(def, tag);
    //Starting tracing, see XML snippet below. 
    service.TraceEnabled = true; 
    //Update the message with our new tag.                 

    The issue is the server is throwing "Internal Server Errors' in response as shown in the trace below. Its not a general issue with credentials/autodiscover as I'm able to bind to messages and retrieve information about them without an issue. 

    Does anyone have any ideas? 

    <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2014-03-03 12:52:49Z">
    POST /EWS/Exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/15.00.0516.014
    Accept-Encoding: gzip,deflate
    <Trace Tag="EwsRequest" Tid="1" Time="2014-03-03 12:52:49Z" Version="15.00.0516.
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="" xmlns:m="" xmlns:t="http://sc" xmlns:soap="http://schemas.xml">
          <t:RequestServerVersion Version="Exchange2007_SP1" />
            <t:TimeZoneDefinition Id="GMT Standard Time" />
          <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOver
                <t:ItemId Id="<<Removed>>=" ChangeKey="<<Removed>>" />
                    <t:ExtendedFieldURI PropertySetId="2b3c76fb-2ea6-4644-a9d1-ae5b5
    8b4396b" PropertyName="mytag" PropertyType="String" />
                        <t:ExtendedFieldURI PropertySetId="2b3c76fb-2ea6-4644-a9d1-a
    e5b58b4396b" PropertyName="mytag" PropertyType="String" />
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2014-03-03 12:52:49Z">
    HTTP/1.1 200 OK
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Content-Length: 551
    Cache-Control: private, max-age=0
    Content-Type: text/xml; charset=utf-8
    Date: Mon, 03 Mar 2014 12:52:49 GMT
    Server: Microsoft-IIS/7.0
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    <Trace Tag="EwsResponse" Tid="1" Time="2014-03-03 12:52:49Z" Version="15.00.0516
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="" xmlns:xs
    i="" xmlns:xsd="
          <t:ServerVersionInfo MajorVersion="8" MinorVersion="1" MajorBuildNumber="4
    36" MinorBuildNumber="0" Version="Exchange2007_SP1" xmlns:t="http://schemas.micr" />
          <m:UpdateItemResponse xmlns:t="
    ces/2006/types" xmlns:m="
              <m:UpdateItemResponseMessage ResponseClass="Error">
                <m:MessageText>An internal server error occurred. The operation fail
                <m:Items />

    Monday, March 3, 2014 1:40 PM

All replies

  • I would suggest rather then specifying your own GUID you just use the PublicStrings Guid from the DefaultExtendedPropertySet and that should work okay eg

                //Define the extended property definition. 
                ExtendedPropertyDefinition def = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "my-tag-name", MapiPropertyType.String);
                //Set the extended property to our tag which is a string 
                m.SetExtendedProperty(def, tag);

    It looks like your server is only running SP1 RU4 so you are a fair way behind on patches so you might want to look at updating.


    Tuesday, March 4, 2014 3:28 AM
  • Thanks Glen, 

    I've was previously using the Public Strings Default property set, but it returns the same error. 

    The code works fine against an exchange online account, but I'm not sure how to go about debugging the internal server error. I've tried turning on detailed error logs in IIS but it doesn't seem to generate anything for these requests. 

    Tuesday, March 4, 2014 9:23 AM
  • Can you update other properties ? Can you set the properties on Create ?

    Given that patch level of Exchange your server is running at I would say your first action should be to upgrade to latest service pack and rollup so you have a supportable installation (SP1 rollup 4 was released in October 2008).

    The only other suggestion would be to turn up the diagnostic logging in Exchange


    Wednesday, March 5, 2014 9:27 AM