internal DiscoveryClientProtocol(HttpWebClientProtocol protocol) : base(protocol)
 {
     this.references = new DiscoveryClientReferenceCollection();
     this.documents = new DiscoveryClientDocumentCollection();
     this.inlinedSchemas = new Hashtable();
     this.additionalInformation = new ArrayList();
     this.errors = new DiscoveryExceptionDictionary();
 }
示例#2
0
 internal HttpWebClientProtocol(HttpWebClientProtocol protocol) : base(protocol)
 {
     this.allowAutoRedirect   = protocol.allowAutoRedirect;
     this.enableDecompression = protocol.enableDecompression;
     this.cookieJar           = protocol.cookieJar;
     this.clientCertificates  = protocol.clientCertificates;
     this.proxy     = protocol.proxy;
     this.userAgent = protocol.userAgent;
 }
 internal HttpWebClientProtocol(HttpWebClientProtocol protocol) : base(protocol)
 {
     this.allowAutoRedirect = protocol.allowAutoRedirect;
     this.enableDecompression = protocol.enableDecompression;
     this.cookieJar = protocol.cookieJar;
     this.clientCertificates = protocol.clientCertificates;
     this.proxy = protocol.proxy;
     this.userAgent = protocol.userAgent;
 }
 private void InitAdditionalProperties(HttpWebClientProtocol proxy)
 {
     if (proxyTypeHandlers == null)
     {
         proxyTypeHandlers = new Hashtable();
         CustomHandler[] proxyProperties = Configuration.MasterConfig.ProxyProperties;
         if ((proxyProperties != null) && (proxyProperties.Length > 0))
         {
             foreach (CustomHandler handler in proxyProperties)
             {
                 string typeName = handler.TypeName;
                 string str2 = handler.Handler;
                 if (((typeName != null) && (typeName.Length != 0)) && ((str2 != null) && (str2.Length != 0)))
                 {
                     Type key = Type.GetType(typeName);
                     if (key == null)
                     {
                         NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, typeName));
                     }
                     else
                     {
                         Type type = Type.GetType(str2);
                         if (type == null)
                         {
                             NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, str2));
                         }
                         else
                         {
                             proxyTypeHandlers.Add(key, type);
                         }
                     }
                 }
             }
         }
     }
     for (Type type3 = proxy.GetType(); type3 != typeof(object); type3 = type3.BaseType)
     {
         Type type4 = proxyTypeHandlers[type3] as Type;
         if (type4 != null)
         {
             this.AdditionalProperties = (IAdditionalProperties)Activator.CreateInstance(type4, new object[] { proxy });
             break;
         }
     }
 }
 public RequestProperties(HttpWebClientProtocol proxy)
 {
     if (proxy != null)
     {
         this.Method = HttpMethod.POST;
         this.preAuthenticate = proxy.PreAuthenticate;
         this.timeout = proxy.Timeout;
         this.useCookieContainer = proxy.CookieContainer != null;
         SoapHttpClientProtocol protocol = proxy as SoapHttpClientProtocol;
         if (protocol != null)
         {
             this.allowAutoRedirect = protocol.AllowAutoRedirect;
             this.allowWriteStreamBuffering = protocol.AllowAutoRedirect;
             WebProxy proxy2 = protocol.Proxy as WebProxy;
             this.HttpProxy = ((proxy2 != null) && (proxy2.Address != null)) ? proxy2.Address.ToString() : null;
         }
     }
 }
 public ProxyProperties(HttpWebClientProtocol proxy)
 {
     this.Timeout = proxy.Timeout;
     this.AllowAutoRedirect = proxy.AllowAutoRedirect;
     this.PreAuthenticate = proxy.PreAuthenticate;
     if (proxy.CookieContainer == null)
     {
         this.UseCookieContainer = true;
     }
     this.Server = new ServerProperties();
     this.Server.Url = proxy.Url;
     this.SetCredentialValues(proxy.Credentials, new Uri(this.Server.Url), out this.Server.UseDefaultCredentials, out this.Server.UserNameForBasicAuth, out this.Server.PasswordForBasicAuth);
     WebProxy proxy2 = proxy.Proxy as WebProxy;
     if (proxy2 != null)
     {
         this.HttpProxy = new ServerProperties();
         this.HttpProxy.Url = proxy2.Address.ToString();
         this.SetCredentialValues(proxy2.Credentials, new Uri(this.HttpProxy.Url), out this.HttpProxy.UseDefaultCredentials, out this.HttpProxy.UserNameForBasicAuth, out this.HttpProxy.PasswordForBasicAuth);
     }
     this.InitAdditionalProperties(proxy);
 }
 public RequestProperties(HttpWebClientProtocol proxy)
 {
     allowAutoRedirect = true;
     allowWriteStreamBuffering = true;
     timeout = 0x2710;
     if (proxy != null)
     {
         Method = HttpMethod.POST;
         preAuthenticate = proxy.PreAuthenticate;
         timeout = proxy.Timeout;
         useCookieContainer = proxy.CookieContainer != null;
         SoapHttpClientProtocol protocol1 = proxy as SoapHttpClientProtocol;
         if (protocol1 != null)
         {
             allowAutoRedirect = protocol1.AllowAutoRedirect;
             allowWriteStreamBuffering = protocol1.AllowAutoRedirect;
             WebProxy proxy1 = protocol1.Proxy as WebProxy;
             HttpProxy = ((proxy1 != null) && (proxy1.Address != null)) ? proxy1.Address.ToString() : null;
         }
     }
 }
 public void UpdateProxy(HttpWebClientProtocol proxy)
 {
     proxy.Timeout = this.Timeout;
     proxy.AllowAutoRedirect = this.AllowAutoRedirect;
     proxy.PreAuthenticate = this.PreAuthenticate;
     if (this.UseCookieContainer)
     {
         if (proxy.CookieContainer == null)
         {
             proxy.CookieContainer = new CookieContainer();
         }
     }
     else
     {
         proxy.CookieContainer = null;
     }
     proxy.Url = this.Server.Url;
     proxy.Credentials = this.ReadCredentials(proxy.Credentials, new Uri(this.Server.Url), this.Server.UseDefaultCredentials, this.Server.UserNameForBasicAuth, this.Server.PasswordForBasicAuth);
     if (((this.HttpProxy != null) && (this.HttpProxy.Url != null)) && (this.HttpProxy.Url.Length > 0))
     {
         Uri uri = new Uri(this.HttpProxy.Url);
         if (proxy.Proxy == null)
         {
             proxy.Proxy = new WebProxy();
         }
         WebProxy proxy2 = proxy.Proxy as WebProxy;
         proxy2.Address = uri;
         proxy2.Credentials = this.ReadCredentials(proxy2.Credentials, uri, this.Server.UseDefaultCredentials, this.Server.UserNameForBasicAuth, this.Server.PasswordForBasicAuth);
     }
     if (this.additionalProperties != null)
     {
         this.additionalProperties.UpdateProxy(proxy);
     }
 }
示例#9
0
        protected override sealed ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            if (executionContext == null)
            {
                throw new ArgumentNullException("executionContext");
            }

            if (SessionId != "" && SessionId != null)
            {
                PopulateSessionCookie();
            }


            // Create instance of Proxy.
            object proxyInstance = Activator.CreateInstance(this.ProxyClass);

            //Set Session Cookie
            System.Web.Services.Protocols.HttpWebClientProtocol proxy = proxyInstance as System.Web.Services.Protocols.HttpWebClientProtocol;
            System.Diagnostics.Debug.Assert(proxy != null);
            proxy.CookieContainer = this.SessionCookieContainer;

            //Invoke OnBefore Invoke
            this.RaiseGenericEvent(InvokeWebServiceActivity.InvokingEvent, this, new InvokeWebServiceEventArgs(proxyInstance));

            // Get the parameters.
            MethodInfo methodInfo = this.ProxyClass.GetMethod(this.MethodName, BindingFlags.Instance | BindingFlags.Public);

            object[] actualParameters = InvokeHelper.GetParameters(methodInfo, this.ParameterBindings);

            WorkflowParameterBinding resultBinding = null;

            if (this.ParameterBindings.Contains("(ReturnValue)"))
            {
                resultBinding = this.ParameterBindings["(ReturnValue)"];
            }

            Object result = null;

            try
            {
                //Invoke the Web Service.
                result = this.ProxyClass.InvokeMember(this.MethodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, proxyInstance, actualParameters, System.Globalization.CultureInfo.InvariantCulture);
            }
            catch (TargetInvocationException e)
            {
                if (e.InnerException != null)
                {
                    throw e.InnerException;
                }
                else
                {
                    throw;
                }
            }

            // Save the result.
            if (resultBinding != null)
            {
                resultBinding.Value = result;
            }

            // Save ref parameters.
            InvokeHelper.SaveOutRefParameters(actualParameters, methodInfo, this.ParameterBindings);

            //Invoke OnAfter Invoke
            this.RaiseGenericEvent(InvokeWebServiceActivity.InvokedEvent, this, new InvokeWebServiceEventArgs(proxyInstance));

            return(ActivityExecutionStatus.Closed);
        }
示例#10
0
 public ProxyProperty(HttpWebClientProtocol proxy) : base(new System.Type[] { typeof(ProxyProperties) }, "Proxy")
 {
     this.proxy = proxy;
     this.proxyProperties = new ProxyProperties(proxy);
 }
 internal DiscoveryClientProtocol(HttpWebClientProtocol protocol) : base(protocol) {
 }
 private static void addStuff(HttpWebClientProtocol ret)
 {
     var cache = new CredentialCache
                     {
                         {new Uri(ret.Url), "NTLM", CredentialCache.DefaultNetworkCredentials},
                         {new Uri(ret.Url), "Kerberos", CredentialCache.DefaultNetworkCredentials}
                     };
     ret.Credentials = cache;
 }
 private void InitAdditionalProperties(HttpWebClientProtocol proxy)
 {
     if (proxyTypeHandlers == null)
     {
         proxyTypeHandlers = new Hashtable();
         CustomHandler[] handlerArray1 = Configuration.MasterConfig.ProxyProperties;
         if ((handlerArray1 != null) && (handlerArray1.Length > 0))
         {
             foreach (CustomHandler handler1 in handlerArray1)
             {
                 string text1 = handler1.TypeName;
                 string text2 = handler1.Handler;
                 if (((text1 != null) && (text1.Length != 0)) && ((text2 != null) && (text2.Length != 0)))
                 {
                     Type type1 = Type.GetType(text1);
                     if (type1 == null)
                     {
                         MainForm.ShowMessage(this, MessageType.Warning,
                                              string.Format(typeNotFoundMessage, text1));
                     }
                     else
                     {
                         Type type2 = Type.GetType(text2);
                         if (type2 == null)
                         {
                             MainForm.ShowMessage(this, MessageType.Warning,
                                                  string.Format(typeNotFoundMessage, text2));
                         }
                         else
                         {
                             proxyTypeHandlers.Add(type1, type2);
                         }
                     }
                 }
             }
         }
     }
     for (Type type3 = proxy.GetType(); type3 != typeof (object); type3 = type3.BaseType)
     {
         Type type4 = proxyTypeHandlers[type3] as Type;
         if (type4 != null)
         {
             AdditionalProperties = (IAdditionalProperties) Activator.CreateInstance(type4, new object[] {proxy});
             return;
         }
     }
 }
 public void UpdateProxy(HttpWebClientProtocol proxy)
 {
     proxy.Timeout = Timeout;
     proxy.AllowAutoRedirect = AllowAutoRedirect;
     proxy.PreAuthenticate = PreAuthenticate;
     if (UseCookieContainer)
     {
         if (proxy.CookieContainer == null)
         {
             proxy.CookieContainer = new CookieContainer();
         }
     }
     else
     {
         proxy.CookieContainer = null;
     }
     proxy.Url = Server.Url;
     proxy.Credentials =
         ReadCredentials(proxy.Credentials, new Uri(Server.Url), Server.UseDefaultCredentials,
                         Server.UserNameForBasicAuth, Server.PasswordForBasicAuth);
     if (((HttpProxy != null) && (HttpProxy.Url != null)) && (HttpProxy.Url.Length > 0))
     {
         Uri uri1 = new Uri(HttpProxy.Url);
         if (proxy.Proxy == null)
         {
             proxy.Proxy = new WebProxy();
         }
         WebProxy proxy1 = proxy.Proxy as WebProxy;
         proxy1.Address = uri1;
         proxy1.Credentials =
             ReadCredentials(proxy1.Credentials, uri1, Server.UseDefaultCredentials, Server.UserNameForBasicAuth,
                             Server.PasswordForBasicAuth);
     }
     if (additionalProperties != null)
     {
         additionalProperties.UpdateProxy(proxy);
     }
 }