Beispiel #1
0
        //启动cad wcf
        private bool StartCADWCF(CADTaskServer cadServer, String url)
        {
            try
            {
                string[] str     = url.Split('/');
                string   name    = str[str.Length - 1];
                string   urlName = url.Remove(url.Length - name.Length - 1);

                var ser = new CADWCFServer(cadServer);
                this.host = new ServiceHost(ser, new Uri(urlName));
                this.host.AddServiceEndpoint(typeof(ICADWCFService), new NetTcpBinding(), name);
                this.host.Open();

                return(true);
            }
            catch (Exception ex)
            {
                this.formCADTaskServer.SentLogErrorMessage(ex.Message + ex.StackTrace);
                return(false);
            }
        }
Beispiel #2
0
 public CADWCFServer(CADTaskServer taskServer)
 {
     this.cad = taskServer;
 }