예제 #1
0
        public override WebResponse GetResponse()
        {
            WebResponse response4;

            requestProperties.contentType = this.webRequest.ContentType;
            requestProperties.soapAction  = this.webRequest.Headers["SOAPAction"];
            requestProperties.url         = this.webRequest.RequestUri.ToString();
            if (this.webRequest.Method.ToUpper() == "POST")
            {
                requestProperties.Method = RequestProperties.HttpMethod.POST;
                Stream requestStream = this.webRequest.GetRequestStream();

                requestStream.Write(this.stream.GetBuffer(), 0, (int)this.stream.Length);
                requestStream.Close();
                this.stream.Position             = 0L;
                requestProperties.requestPayLoad = MessageTracer.ReadMessage(this.stream, requestProperties.contentType);
            }
            else if (this.webRequest.Method.ToUpper() == "GET")
            {
                requestProperties.Method = RequestProperties.HttpMethod.GET;
            }
            try
            {
                if (ClientCertificates != null)
                {
                    this.webRequest.ClientCertificates.Add(ClientCertificates[0]);
                }
                WSSWebResponse response2 = new WSSWebResponse(this.webRequest.GetResponse());
                requestProperties.responsePayLoad = response2.DumpResponse();
                response4 = response2;
            }
            catch (WebException exception)
            {
                if (exception.Response != null)
                {
                    WSSWebResponse response = new WSSWebResponse(exception.Response);
                    requestProperties.responsePayLoad = response.DumpResponse();
                    throw new WebException(exception.Message, exception, exception.Status, response);
                }
                requestProperties.responsePayLoad = exception.ToString();
                throw;
            }
            catch (Exception exception2)
            {
                requestProperties.responsePayLoad = exception2.ToString();
                throw;
            }
            return(response4);
        }
예제 #2
0
        public override WebResponse GetResponse()
        {
            WebResponse response4;

            requestProperties.contentType = webRequest.ContentType;
            requestProperties.soapAction  = webRequest.Headers["SOAPAction"];
            requestProperties.url         = webRequest.RequestUri.ToString();
            if (webRequest.Method.ToUpper() == "POST")
            {
                requestProperties.Method = RequestProperties.HttpMethod.POST;
                Stream stream1 = webRequest.GetRequestStream();
                stream1.Write(stream.GetBuffer(), 0, (int)stream.Length);
                stream1.Close();
                stream.Position = 0;
                requestProperties.requestPayLoad = MessageTracer.ReadMessage(stream, requestProperties.contentType);
            }
            else if (webRequest.Method.ToUpper() == "GET")
            {
                requestProperties.Method = RequestProperties.HttpMethod.GET;
            }
            try
            {
                WebResponse    response1 = webRequest.GetResponse();
                WSSWebResponse response2 = new WSSWebResponse(response1);
                requestProperties.responsePayLoad = response2.DumpResponse();
                response4 = response2;
            }
            catch (WebException exception1)
            {
                if (exception1.Response != null)
                {
                    WSSWebResponse response3 = new WSSWebResponse(exception1.Response);
                    requestProperties.responsePayLoad = response3.DumpResponse();
                    throw new WebException(exception1.Message, exception1, exception1.Status, response3);
                }
                requestProperties.responsePayLoad = exception1.ToString();
                throw;
            }
            catch (Exception exception2)
            {
                requestProperties.responsePayLoad = exception2.ToString();
                throw;
            }
            return(response4);
        }
예제 #3
0
 public override WebResponse GetResponse()
 {
     WebResponse response4;
     requestProperties.contentType = this.webRequest.ContentType;
     requestProperties.soapAction = this.webRequest.Headers["SOAPAction"];
     requestProperties.url = this.webRequest.RequestUri.ToString();
     if (this.webRequest.Method.ToUpper() == "POST")
     {
         requestProperties.Method = RequestProperties.HttpMethod.POST;
         Stream requestStream = this.webRequest.GetRequestStream();
         requestStream.Write(this.stream.GetBuffer(), 0, (int) this.stream.Length);
         requestStream.Close();
         this.stream.Position = 0L;
         requestProperties.requestPayLoad = MessageTracer.ReadMessage(this.stream, requestProperties.contentType);
     }
     else if (this.webRequest.Method.ToUpper() == "GET")
     {
         requestProperties.Method = RequestProperties.HttpMethod.GET;
     }
     try
     {
         WSSWebResponse response2 = new WSSWebResponse(this.webRequest.GetResponse());
         requestProperties.responsePayLoad = response2.DumpResponse();
         response4 = response2;
     }
     catch (WebException exception)
     {
         if (exception.Response != null)
         {
             WSSWebResponse response = new WSSWebResponse(exception.Response);
             requestProperties.responsePayLoad = response.DumpResponse();
             throw new WebException(exception.Message, exception, exception.Status, response);
         }
         requestProperties.responsePayLoad = exception.ToString();
         throw;
     }
     catch (Exception exception2)
     {
         requestProperties.responsePayLoad = exception2.ToString();
         throw;
     }
     return response4;
 }