Sintomas
A tentativa de gerar automaticamente código de proxy com base no esquema do Microsoft Exchange Server 2010 Service Pack 1 (SP1). Nessa situação, a seguinte linha está ausente no código do proxy:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Portanto, os proxies gerados automaticamente não suportam Exchange Impersonation.This problema afeta as seguintes três operações:
-
GetUserOofSettings
-
SetUserOofSettings
-
GetUserAvailability
Resolução
Para resolver esse problema, instale o seguinte update rollup:
2579150 Descrição do pacote cumulativo de atualizações 4 do Exchange Server 2010 Service Pack 1
Solução alternativa
Para contornar esse problema, use Microsoft Exchange Web Services (EWS) gerenciado API 1.1 para alterar as classes geradas no esquema. Para fazer isso, adicione a seguinte linha no código do proxy:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Abaixo está uma amostra para a operação GetUserOofSettings . Código original:
[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]));}
Código alterado:
[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
A Microsoft confirmou que este é um problema nos produtos Microsoft listados na seção "Aplicável a".
Informações adicionais
Para obter mais informações sobre a operação de GetUserOofSettings , visite o seguinte site da Microsoft:
Informações gerais sobre a operação de GetUserOofSettingsPara obter mais informações sobre a operação de SetUserOofSettings , visite o seguinte site da Microsoft:
Informações gerais sobre a operação de SetUserOofSettingsPara obter mais informações sobre a operação de GetUserAvailability , visite o seguinte site da Microsoft:
Informações gerais sobre a operação de GetUserAvailabilityPara obter mais informações sobre representação do Exchange, visite o seguinte site da Microsoft: