/// <summary> /// This method is used by the client to get specific properties on an object. /// </summary> /// <param name="getPropsRequestBody">The GetProps request type request body.</param> /// <param name="responseCodeHeader">The value of X-ResponseCode header</param> /// <returns>The response body of the GetProps request type.</returns> public GetPropsResponseBody GetProps(GetPropsRequestBody getPropsRequestBody, out uint responseCodeHeader) { byte[] rawBuffer; CommonResponse commonResponse = null; WebHeaderCollection webHeaderCollection = AdapterHelper.InitializeHTTPHeader(RequestType.GetProps, AdapterHelper.ClientInstance, AdapterHelper.Counter); // Send the Execute HTTP request and get the response. HttpWebResponse response = this.SendMAPIHttpRequest(this.userName, this.password, getPropsRequestBody, ServerEndpoint.AddressBookServerEndpoint, AdapterHelper.SessionContextCookies, webHeaderCollection, out rawBuffer); responseCodeHeader = AdapterHelper.GetFinalResponseCode(response.Headers["X-ResponseCode"]); // Read the HTTP response buffer and parse the response to correct format. commonResponse = CommonResponse.ParseCommonResponse(rawBuffer); response.GetResponseStream().Close(); AdapterHelper.SessionContextCookies = response.Cookies; GetPropsResponseBody getPropsResponseBody = new GetPropsResponseBody(); if (commonResponse.ResponseBodyRawData.Length > 0) { getPropsResponseBody = GetPropsResponseBody.Parse(commonResponse.ResponseBodyRawData); } return(getPropsResponseBody); }
/// <summary> /// This method is used by the client to get specific properties on an object. /// </summary> /// <param name="getPropsRequestBody">The GetProps request type request body.</param> /// <returns>The response body of the GetProps request type.</returns> public GetPropsResponseBody GetProps(GetPropsRequestBody getPropsRequestBody) { CommonResponse commonResponse = this.SendAddressBookRequest(getPropsRequestBody, RequestType.GetProps); GetPropsResponseBody getPropsResponseBody = GetPropsResponseBody.Parse(commonResponse.ResponseBodyRawData); this.VerifyGetPropsResponseBody(getPropsResponseBody); return(getPropsResponseBody); }
/// <summary> /// This method is used by the client to get specific properties on an object. /// </summary> /// <param name="getPropsRequestBody">The GetProps request type request body.</param> /// <param name="responseCodeHeader">The value of X-ResponseCode header</param> /// <returns>The response body of the GetProps request type.</returns> public GetPropsResponseBody GetProps(GetPropsRequestBody getPropsRequestBody,out uint responseCodeHeader) { byte[] rawBuffer; CommonResponse commonResponse = null; WebHeaderCollection webHeaderCollection = AdapterHelper.InitializeHTTPHeader(RequestType.GetProps, AdapterHelper.ClientInstance, AdapterHelper.Counter); // Send the Execute HTTP request and get the response. HttpWebResponse response = this.SendMAPIHttpRequest(this.userName, this.password, getPropsRequestBody, ServerEndpoint.AddressBookServerEndpoint, AdapterHelper.SessionContextCookies, webHeaderCollection, out rawBuffer); responseCodeHeader = AdapterHelper.GetFinalResponseCode(response.Headers["X-ResponseCode"]); // Read the HTTP response buffer and parse the response to correct format. commonResponse = CommonResponse.ParseCommonResponse(rawBuffer); response.GetResponseStream().Close(); AdapterHelper.SessionContextCookies = response.Cookies; GetPropsResponseBody getPropsResponseBody = new GetPropsResponseBody(); if (commonResponse.ResponseBodyRawData.Length > 0) { getPropsResponseBody= GetPropsResponseBody.Parse(commonResponse.ResponseBodyRawData); } return getPropsResponseBody; }
/// <summary> /// Build the GetProps request body. /// </summary> /// <param name="flags">A set of bit flags that specify options to the server.</param> /// <param name="hasState">A Boolean value that specifies whether the State field is present.</param> /// <param name="stat">A STAT structure that specifies the state of a specific address book container.</param> /// <param name="hasPropertyTags">A Boolean value that specifies whether the PropertyTags field is present.</param> /// <param name="propetyTags">A LargePropertyTagArray structure that contains the property tags of the properties that the client is requesting.</param> /// <returns>The GetProps request body.</returns> private GetPropsRequestBody BuildGetPropsRequestBody(uint flags, bool hasState, STAT? stat, bool hasPropertyTags, LargePropertyTagArray propetyTags) { GetPropsRequestBody getPropertyRequestBody = new GetPropsRequestBody(); getPropertyRequestBody.Flags = flags; byte[] auxIn = new byte[] { }; getPropertyRequestBody.AuxiliaryBuffer = auxIn; getPropertyRequestBody.AuxiliaryBufferSize = (uint)auxIn.Length; getPropertyRequestBody.HasState = hasState; if (hasState) { getPropertyRequestBody.State = (STAT)stat; } getPropertyRequestBody.HasPropertyTags = hasPropertyTags; if (hasPropertyTags) { getPropertyRequestBody.PropertyTags = propetyTags; } return getPropertyRequestBody; }
/// <summary> /// This method is used by the client to get specific properties on an object. /// </summary> /// <param name="getPropsRequestBody">The GetProps request type request body.</param> /// <returns>The response body of the GetProps request type.</returns> public GetPropsResponseBody GetProps(GetPropsRequestBody getPropsRequestBody) { CommonResponse commonResponse = this.SendAddressBookRequest(getPropsRequestBody, RequestType.GetProps); GetPropsResponseBody getPropsResponseBody = GetPropsResponseBody.Parse(commonResponse.ResponseBodyRawData); this.VerifyGetPropsResponseBody(getPropsResponseBody); return getPropsResponseBody; }