public Message Execute(Message message, TimeSpan timeout)
        {
            System.Diagnostics.Debug.WriteLine(
                "Sending an outbound message",
                "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            XmlDictionaryReader xdr = message.GetReaderAtBodyContents();

            System.Diagnostics.Debug.WriteLine("Reading the message body in base64 encoding");

            // Reading the message contents as a base64 encoded string
            if (xdr.NodeType == XmlNodeType.Element)
            {
                // In case the content is nested in an element under the Body element
                xdr.Read();
            }

            byte[] msgBuffer = xdr.ReadContentAsBase64();

            var encoding = Encoding.GetEncoding(
                this.Connection.ConnectionFactory.Adapter.Encoding);
            // Create MockMessage isntance
            var mockMessage = new MockMessage(
                msgBuffer,
                encoding);

            CopyPromotedProperties(message, mockMessage);

            using (StreamingNamedPipeClient pipeClient = new StreamingNamedPipeClient(
                       Connection.ConnectionFactory.ConnectionUri.Uri))
            {
                pipeClient.Connect((int)timeout.TotalMilliseconds);

                System.Diagnostics.Debug.WriteLine(
                    "The pipe client was connected!Sending the outbound message over the pipe",
                    "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

                pipeClient.WriteMessage(mockMessage);

                System.Diagnostics.Debug.WriteLine(
                    "Outbound message sent!",
                    "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

                // Check if the IsSolicitResponse context property is present and set to true
                bool   isTwoWay = false;
                object isSolicitResponseValue;

                if (message.Properties.TryGetValue(
                        "http://schemas.microsoft.com/BizTalk/2003/system-properties#IsSolicitResponse",
                        out isSolicitResponseValue))
                {
                    isTwoWay = Convert.ToBoolean(
                        isSolicitResponseValue,
                        CultureInfo.InvariantCulture);
                }

                // Check if the CorrelationToken prometed property is present
                if (isTwoWay)
                {
                    // We are in a two-way communication scenario
                    System.Diagnostics.Debug.WriteLine(
                        "Two-way communication - reading the response message",
                        "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

                    string respContents = null;

                    // We proceed with waiting for the response
                    Message responseMsg         = null;
                    var     responseMockMessage = pipeClient.ReadMessage();

                    respContents = string.Format(
                        CultureInfo.InvariantCulture,
                        "<MessageContent>{0}</MessageContent>",
                        responseMockMessage.BodyBase64);

                    XmlReader respReader = XmlReader.Create(new StringReader(respContents));

                    System.Diagnostics.Debug.WriteLine(
                        "Constructing the response WCF Message",
                        "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

                    responseMsg = Message.CreateMessage(MessageVersion.Default, string.Empty, respReader);

                    // Check if there are returned some properties that needs to be written/promoted to the message context
                    foreach (var property in responseMockMessage.Properties)
                    {
                        if (responseMsg.Properties.ContainsKey(property.Key))
                        {
                            responseMsg.Properties[property.Key] = property.Value;
                        }
                        else
                        {
                            responseMsg.Properties.Add(
                                property.Key, property.Value);
                        }
                    }

                    System.Diagnostics.Debug.WriteLine(
                        "Response WCF Message constructed. Returning it to BizTalk",
                        "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");

                    return(responseMsg);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine(
                        "One way communication - returning empty response WCF Message to BizTalk",
                        "TransMock.Wcf.Adapter.MockAdapterOutboundHandler");
                    // Return empty message in one-way scenario
                    return(Message.CreateMessage(MessageVersion.Default, string.Empty));
                }
            }
        }