Symptom
Du försöker generera proxy kod som baseras på Microsoft Exchange Server 2010 Service Pack 1 (SP1)-schemat automatiskt. I det här fallet saknas följande rad i koden proxy:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Därför stöder automatiskt genererad proxy inte Exchange Impersonation.This problemet påverkar följande tre åtgärder:
-
GetUserOofSettings
-
SetUserOofSettings
-
GetUserAvailability
Lösning
Lös problemet genom att installera följande uppdatering:
2579150 Beskrivning av Samlad uppdatering 4 för Exchange Server 2010 servicepack 1
Lösning
Undvik problemet genom att använda Microsoft Exchange Web Services (EWS) hanterade API 1.1 för att ändra genererade klasser i schemat. Om du vill göra detta lägger du till följande rad i proxy-kod:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Nedan ges ett exempel för åtgärden GetUserOofSettings . Ursprunglig kod:
[System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)][System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetUserOofSettings", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)][return: System.Xml.Serialization.XmlElementAttribute("GetUserOofSettingsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")]public GetUserOofSettingsResponse GetUserOofSettings([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetUserOofSettingsRequest GetUserOofSettingsRequest){ object[] results = this.Invoke("GetUserOofSettings", new object[] { GetUserOofSettingsRequest}); return ((GetUserOofSettingsResponse)(results[0]));}
Ändrad kod:
[System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)][System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")][System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetUserOofSettings", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)][return: System.Xml.Serialization.XmlElementAttribute("GetUserOofSettingsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")]public GetUserOofSettingsResponse GetUserOofSettings([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetUserOofSettingsRequest GetUserOofSettingsRequest){ object[] results = this.Invoke("GetUserOofSettings", new object[] { GetUserOofSettingsRequest}); return ((GetUserOofSettingsResponse)(results[0]));}
Status
Microsoft har bekräftat att detta är ett problem i Microsoft-produkterna som nämns i avsnittet ”gäller”.
Mer information
Mer information om GetUserOofSettings -funktionen finns på följande Microsoft-webbplats:
Allmän information om hur GetUserOofSettingsMer information om SetUserOofSettings -funktionen finns på följande Microsoft-webbplats:
Allmän information om hur SetUserOofSettingsMer information om GetUserAvailability -funktionen finns på följande Microsoft-webbplats:
Allmän information om hur GetUserAvailabilityMer information om personifiering för Exchange finns på följande Microsoft-webbplats: