Sintomi
Si tenta di generare automaticamente il codice proxy sulla base dello schema di Microsoft Exchange Server 2010 Service Pack 1 (SP1). In questo caso, la riga seguente non è presente nel codice proxy:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Di conseguenza, i proxy generati automaticamente non supportano Exchange Impersonation.This problema interessa le tre operazioni seguenti:
-
GetUserOofSettings
-
SetUserOofSettings
-
GetUserAvailability
Risoluzione
Per risolvere questo problema, installare l'aggiornamento cumulativo seguente:
2579150 Descrizione dell'aggiornamento cumulativo 4 per Exchange Server 2010 Service Pack 1
Soluzione alternativa
Per risolvere questo problema, utilizzare Microsoft Exchange Web Services (EWS) Managed API 1.1 per modificare le classi generate nello schema. A tale scopo, aggiungere la seguente riga nel codice proxy:
[System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")]
Di seguito è riportato un esempio per l'operazione GetUserOofSettings . Codice originale:
[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]));}
Codice modificato:
[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]));}
Stato
Microsoft ha confermato che questo problema si verifica nei prodotti elencati nella sezione "Si applica a".
Ulteriori informazioni
Per ulteriori informazioni sull'operazione di GetUserOofSettings , visitare il seguente sito Web Microsoft:
Informazioni generali sull'operazione di GetUserOofSettingsPer ulteriori informazioni sull'operazione di SetUserOofSettings , visitare il seguente sito Web Microsoft:
Informazioni generali sull'operazione di SetUserOofSettingsPer ulteriori informazioni sull'operazione di GetUserAvailability , visitare il seguente sito Web Microsoft:
Informazioni generali sull'operazione di GetUserAvailabilityPer ulteriori informazioni sulla rappresentazione di Exchange, visitare il seguente sito Web Microsoft: