Beispiel #1
0
        /// <summary>
        /// Retrieves the profile image for a mailbox
        /// </summary>
        /// <param name="getUserPhotoRequest">The request of GetUserPhoto operation.</param>
        /// <returns>A response to GetUserPhoto operation request.</returns>
        public GetUserPhotoResponseMessageType GetUserPhoto(GetUserPhotoType getUserPhotoRequest)
        {
            GetUserPhotoResponseMessageType getUserPhotoResponse = this.exchangeServiceBinding.GetUserPhoto(getUserPhotoRequest);

            #region Verifiy GetUserPhoto opreation requirements
            this.VerifySoapVersion();
            this.VerifyTransportType();
            #endregion

            return(getUserPhotoResponse);
        }
Beispiel #2
0
 public override void EndProxyWebRequest(ProxyWebRequest proxyWebRequest, QueryList queryList, IService service, IAsyncResult asyncResult)
 {
     try
     {
         GetUserPhotoResponseMessageType getUserPhotoResponseMessageType = service.EndGetUserPhoto(asyncResult);
         queryList.SetResultInAllQueries(new UserPhotoQueryResult(getUserPhotoResponseMessageType.PictureData, getUserPhotoResponseMessageType.CacheId, getUserPhotoResponseMessageType.StatusCode, getUserPhotoResponseMessageType.Expires, getUserPhotoResponseMessageType.ContentType, this.upstreamTracer));
     }
     finally
     {
         this.proxyLatencyTracker.Stop();
     }
 }
        /// <summary>
        /// Retrieves the profile image for a mailbox
        /// </summary>
        /// <param name="getUserPhotoRequest">The request of GetUserPhoto operation.</param>
        /// <returns>A response to GetUserPhoto operation request.</returns>
        public GetUserPhotoResponseMessageType GetUserPhoto(GetUserPhotoType getUserPhotoRequest)
        {
            GetUserPhotoResponseMessageType getUserPhotoResponse = this.exchangeServiceBinding.GetUserPhoto(getUserPhotoRequest);

            #region Verifiy GetUserPhoto opreation requirements
            this.VerifySoapVersion();
            this.VerifyTransportType();

            this.VerifyServerVersionInfo(this.exchangeServiceBinding.ServerVersionInfoValue, this.exchangeServiceBinding.IsSchemaValidated);
            this.VerifyGetUserPhotoResponseMessageType(getUserPhotoResponse, this.exchangeServiceBinding.IsSchemaValidated);
            #endregion

            return(getUserPhotoResponse);
        }
Beispiel #4
0
        public void MSOXWSCONT_S07_TC01_SetUserPhotoSuccess()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(1275114, this.Site), "Implementation does not support the SetUserPhoto operation.");

            #region Step 1: Call SetUserPhoto operation to set a photo to specific user.
            string emailAddress = string.Format("{0}@{1}", Common.GetConfigurationPropertyValue("ContactUserName", this.Site), Common.GetConfigurationPropertyValue("Domain", this.Site));

            SetUserPhotoType setUserPhotoRequest = new SetUserPhotoType();
            setUserPhotoRequest.Email = emailAddress;

            using (FileStream imageStream = new FileStream("UserPhoto.jpg", FileMode.Open, FileAccess.ReadWrite))
            {
                byte[] buffer = new byte[imageStream.Length];

                imageStream.Read(buffer, 0, (int)imageStream.Length);

                string imagContent = System.Convert.ToBase64String(buffer);
                setUserPhotoRequest.Content = imagContent;
            }

            SetUserPhotoResponseMessageType setUserPhotoResponse = this.CONTAdapter.SetUserPhoto(setUserPhotoRequest);

            Site.Assert.IsNotNull(setUserPhotoResponse, "SetUserPhoto operation success.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302081");

            // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302081
            this.Site.CaptureRequirementIfIsNotNull(
                setUserPhotoResponse,
                302081,
                @"[In SetUserPhoto] [The protocol client sends a SetUserPhotoSoapIn request WSDL message] and the protocol server responds with a SetUserPhotoSoapOut response WSDL message");

            #endregion

            #region Step 2: Call GetUserPhoto operation to get the photo which is set by step above.
            GetUserPhotoType getUserPhotoRequest = new GetUserPhotoType();
            getUserPhotoRequest.Email         = emailAddress;
            getUserPhotoRequest.SizeRequested = UserPhotoSizeType.HR96x96;

            GetUserPhotoResponseMessageType getUserPhotoResponse = this.CONTAdapter.GetUserPhoto(getUserPhotoRequest);

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302024");

            // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302024
            this.Site.CaptureRequirementIfAreEqual <ResponseClassType>(
                ResponseClassType.Success,
                getUserPhotoResponse.ResponseClass,
                302024,
                @"[In GetUserPhotoSoapOut] A successful GetUserPhoto WSDL operation request returns a GetUserPhotoResponse element with the ResponseClass attribute set to ""Success"".");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302025");

            // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302025
            this.Site.CaptureRequirementIfAreEqual <ResponseCodeType>(
                ResponseCodeType.NoError,
                getUserPhotoResponse.ResponseCode,
                302025,
                @"[In GetUserPhotoSoapOut] [A successful GetUserPhoto WSDL operation request returns a GetUserPhotoResponse element ] The ResponseCode element of the GetUserPhotoResponse element is set to ""No Error"".");
            #endregion
        }