示例#1
0
        /// <summary>
        /// Asynchronously starts sending a request
        /// </summary>
        /// <param name="message">Request message</param>
        /// <param name="documentId">The document Id used for the custom headers</param>
        /// <param name="response">The response object</param>
        /// <param name="callback">The asynchronous callback</param>
        /// <returns>Returns an IAsyncResult object</returns>
        public IAsyncResult BeginGetResponse(OiosiMessage message, string documentId, out Response response, AsyncCallback callback)
        {
            // Validate the OiosiMessage
            SendingValidation sendingValidation = new SendingValidation();

            sendingValidation.Validate(message);

            AddCustomHeaders(message, documentId);
            return(this.incapsulatedRequest.BeginGetResponse(message, out response, callback));
        }
示例#2
0
        /// <summary>
        /// Synchronously sends a request and gets a response
        /// </summary>
        /// <param name="request">Request message</param>
        /// <param name="documentId">The document Id used in the MessageIdentifier header</param>
        /// <param name="response">The response. If this parameter is set the sending went well and the response is safe to use</param>
        public void GetResponse(OiosiMessage request, string documentId, out Response response)
        {
            // Validate the OiosiMessage
            SendingValidation sendingValidation = new SendingValidation();

            sendingValidation.Validate(request);

            this.AddCustomHeaders(request, documentId);
            this.incapsulatedRequest.GetResponse(request, out response);
        }