A class indicates the response body of unbind request
Inheritance: AddressBookResponseBodyBase
示例#1
0
        /// <summary>
        /// The NspiUnbind method destroys the context handle. No other action is taken.
        /// </summary>
        /// <param name="reserved">A DWORD [MS-DTYP] value reserved for future use. This property is ignored by the server.</param>
        /// <returns>A DWORD value that specifies the return status of the method.</returns>
        public uint Unbind(uint reserved)
        {
            uint result;
            UnbindRequestBody unbindRequest   = this.BuildUnbindRequestBody();
            ChunkedResponse   chunkedResponse = this.SendAddressBookRequest(unbindRequest, RequestType.Unbind);

            AdapterHelper.SessionContextCookies = new CookieCollection();
            UnbindResponseBody unbindResponseBody = UnbindResponseBody.Parse(chunkedResponse.ResponseBodyRawData);

            result = unbindResponseBody.ErrorCode;

            return(result);
        }
 /// <summary>
 /// Parse the response data into response body.
 /// </summary>
 /// <param name="rawData">The raw data of response</param>
 /// <returns>The response body of unbind request</returns>
 public static UnbindResponseBody Parse(byte[] rawData)
 {
     UnbindResponseBody responseBody = new UnbindResponseBody();
     int index = 0;
     responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
     index += 4;
     responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
     index += 4;
     responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
     index += 4;
     responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
     Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
     return responseBody;
 }
示例#3
0
        /// <summary>
        /// Parse the response data into response body.
        /// </summary>
        /// <param name="rawData">The raw data of response</param>
        /// <returns>The response body of unbind request</returns>
        public static UnbindResponseBody Parse(byte[] rawData)
        {
            UnbindResponseBody responseBody = new UnbindResponseBody();
            int index = 0;

            responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
            Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
            return(responseBody);
        }