Ejemplo n.º 1
0
        private HttpRequestMessage CopyRequest(HttpRequestMessage request)
        {
            var requestCopy = request.Clone();
            var content     = new SoapMessageContent(requestCopy.Content as SoapMessageContent);

            content.SoapHeaders.Add(new WsSecurityHeader(UserName, Password, WsSecurityHeader.PasswordTypes.PasswordDigest,
                                                         TimeDiff));
            requestCopy.Content = content;
            return(requestCopy);
        }
Ejemplo n.º 2
0
        public SoapMessageContent(SoapMessageContent original)
            : this()
        {
            if (original == null)
            {
                throw new ArgumentNullException("original");
            }

            Action            = original.Action;
            BodyContent       = original.BodyContent;
            EnvelopeNamespace = original.EnvelopeNamespace;
            ContentType       = original.ContentType;

            foreach (var messageHeader in original.SoapHeaders)
            {
                SoapHeaders.Add(messageHeader);
            }
        }