예제 #1
0
 /// <summary>
 /// Update the Address of the Proxy to modify the client Proxy
 /// </summary>
 public static void UpdateProxy(ProxyProperty property)
 {
     (WebProxy.Address, WebProxy.Credentials) = property switch
     {
         ProxyProperty.Enabled => Proxy.Enabled switch
         {
             true => Proxy.UserName switch
             {
                 var userName when !string.IsNullOrEmpty(userName) =>
                 (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), null),
                 _ => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"),
                       new NetworkCredential(Proxy.UserName, Proxy.Password))
             },
예제 #2
0
        private TransformationNodeClass GenerateClassAsTransformation()
        {
            string javaFreandlyName = ElementName.RemoveAll(" ", "_");

            string description = Description;
            string mainClass   = PackageName + "." + javaFreandlyName;
            string creator     = Environment.UserName;

            string[]        neededOtherClasses = new string[0];
            INeedsExtra[]   neededExtras       = new INeedsExtra[0];
            ConfigElement[] config             = new ConfigElement[0];
            ProxyProperty[] proxyProperties    = new ProxyProperty[0];
            string          methodName         = javaFreandlyName;
            bool            isStatic           = true;

            return(new TransformationNodeClass(javaFreandlyName, ElementName, description, creator, OutputType, InputTypes.ToArray(),
                                               mainClass, neededOtherClasses, neededExtras, config, proxyProperties, true, Path.Combine(WorkSpace.DIR, WorkSpace.CREATED_DIR, javaFreandlyName),
                                               methodName, isStatic));
        }
예제 #3
0
        private DataSourceNodeClass GenerateClassAsDataSource()
        {
            string javaFreandlyName = ElementName.RemoveAll(" ", "_");

            string description = Description;
            string mainClass   = PackageName + "." + javaFreandlyName;
            string creator     = Environment.UserName;

            string[]        neededOtherClasses = new string[0];
            INeedsExtra[]   neededExtras       = new INeedsExtra[0];
            ConfigElement[] config             = new ConfigElement[0];
            ProxyProperty[] proxyProperties    = new ProxyProperty[0];
            string          dataMethod         = "getData";
            string          startMethod        = "start";
            string          stopMethod         = "stop";

            return(new DataSourceNodeClass(javaFreandlyName, ElementName, description, creator, OutputType,
                                           mainClass, neededOtherClasses, neededExtras, config, proxyProperties, true, Path.Combine(WorkSpace.DIR, WorkSpace.CREATED_DIR, javaFreandlyName),
                                           dataMethod, startMethod, stopMethod));
        }
예제 #4
0
 private void FillInvokeTab()
 {
     Assembly proxyAssembly = wsdl.ProxyAssembly;
     if (proxyAssembly != null)
     {
         treeMethods.Nodes.Clear();
         foreach (System.Type type in proxyAssembly.GetTypes())
         {
             if (TreeNodeProperty.IsWebService(type))
             {
                 TreeNode node = treeMethods.Nodes.Add(type.Name, type.Name);
                 HttpWebClientProtocol proxy = (HttpWebClientProtocol)Activator.CreateInstance(type);
                 ProxyProperty property = new ProxyProperty(proxy);
                 property.RecreateSubtree(null);
                 node.Tag = property.TreeNode;
                 proxy.Credentials = CredentialCache.DefaultCredentials;
                 SoapHttpClientProtocol protocol2 = proxy as SoapHttpClientProtocol;
                 if (protocol2 != null)
                 {
                     protocol2.CookieContainer = new CookieContainer();
                     protocol2.AllowAutoRedirect = true;
                 }
                 foreach (MethodInfo info in type.GetMethods())
                 {
                     if (TreeNodeProperty.IsWebMethod(info))
                     {
                         node.Nodes.Add(info.Name, info.Name).Tag = info;
                     }
                 }
             }
         }
         this.treeMethods.ExpandAll();
     }
 }