• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ServiceClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ServiceClient的典型用法代码示例。如果您正苦于以下问题:C# ServiceClient类的具体用法?C# ServiceClient怎么用?C# ServiceClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServiceClient类属于命名空间,在下文中一共展示了ServiceClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetListGruArtAufEinSprache

 //
 // GruArtAufEinSprache
 //
 public static List<GruArtAufEinSprache> GetListGruArtAufEinSprache(GruArtAufEinzelnutzen GruArtAufEinzelnutzen)
 {
     using (WZNTServices.ServiceClient Client = new ServiceClient())
     {
         return Client.ReadGruArtAufEinSpracheList(GruArtAufEinzelnutzen).ToList();
     }
 }
开发者ID:pgemeo,项目名称:WZNT,代码行数:10,代码来源:DbManager.cs


示例2: Session_Start

 public void Session_Start(object sender, EventArgs e)
 {
     ServiceClient sc = new ServiceClient();
     sc.Open();
     Session["ServiceClient"] = sc;
     Session["AuthStatus"] = false;
 }
开发者ID:HenChao,项目名称:SeniorDesign,代码行数:7,代码来源:Global.asax.cs


示例3: WorkflowExtensionsBehaviorAddsExtension

        public void WorkflowExtensionsBehaviorAddsExtension()
        {
            WorkflowServiceTestHost host = null;

            // TODO: Test with multiple extensions
            // TODO: Test with bad config file entries
            var serviceEndpoint1 = ServiceTest.GetUniqueEndpointAddress();
            using (host = WorkflowServiceTestHost.Open("ServiceExtensionTest.xamlx", serviceEndpoint1))
            {
                try
                {
                    var proxy = new ServiceClient(ServiceTest.Pipe, serviceEndpoint1);
                    try
                    {
                        proxy.GetData(1);
                        proxy.Close();
                    }
                    catch (Exception)
                    {
                        proxy.Abort();
                        throw;
                    }
                }
                finally
                {
                    if (host != null)
                    {
                        host.Tracking.Trace();
                    }
                }
            }
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:32,代码来源:WorkflowExtensionsBehaviorTest.cs


示例4: Index

        public ActionResult Index()
        {
            var client = new ServiceClient();
            client.Add(new Company {Id = 5, Name = "ABC Company", Address = "1234 Main Street"});

            return View();
        }
开发者ID:marksl,项目名称:ASP.net-MVC-and-WCF-Sample,代码行数:7,代码来源:HomeController.cs


示例5: FileCollector

        public FileCollector(CacheManager cacheManager, FilesModel xmlString)
        {
            _cacheManager = cacheManager;


            // Create a required files object
            _requiredFiles = new RequiredFiles();


            foreach (var item in xmlString.Items)
            {
                _requiredFiles.Files.Add(item);
            }


            // Get the key for later use
            hardwareKey = new HardwareKey();

            // Make a new filelist collection
            _files = new Collection<RequiredFileModel>();

            // Create a webservice call
            xmdsFile = new ServiceClient();

            // Start up the Xmds Service Object
            //xmdsFile.Credentials = null;
            //xmdsFile.Url = Properties.Settings.Default.Client_xmds_xmds;
            //xmdsFile.UseDefaultCredentials = false;

            // Hook onto the xmds file complete event
            xmdsFile.GetFileCompleted += (XmdsFileGetFileCompleted);
        }
开发者ID:afrog33k,项目名称:eAd,代码行数:32,代码来源:FileCollector.cs


示例6: btnAddItem_Click

 private void btnAddItem_Click(object sender, EventArgs e)
 {
     IService service = new ServiceClient();
     int id = Int32.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString());
     Item = service.GetItemFromID(id);
     this.Close();
 }
开发者ID:LasseSLambertsen,项目名称:ucn-3semproject-dmab0914-gruppe1,代码行数:7,代码来源:SearchWindow.cs


示例7: ObtenerAppsSuscripcion

 public static IList<IList<string>> ObtenerAppsSuscripcion()
 {
     using (ServiceClient SCliente = new ServiceClient())
     {
         return SCliente.ObtenerAppsSuscripcion();
     }
 }
开发者ID:jorge-lopez,项目名称:Launch,代码行数:7,代码来源:Aplicaciones.cs


示例8: GetAllTransactionsForUser

 private static IEnumerable<TransactionInfo> GetAllTransactionsForUser(int window, int userId, int group, ServiceClient sc)
 {
     var Costs = sc.GetSplitCosts(group, userId, window).ToList();
     var Payments = sc.GetSplitPayments(group, userId, window).ToList();
     var allSplits = Costs.Union(Payments);
     return allSplits;
 }
开发者ID:HenChao,项目名称:SeniorDesign,代码行数:7,代码来源:StatmentController.cs


示例9: Actualizar

 public void Actualizar(string Nombre, string Apellido, string Contrasegna)
 {
     using (ServiceClient SCliente = new ServiceClient())
     {
         SCliente.ActualizarDeveloper(Nombre, Apellido, this.Correo, Contrasegna);
     }
 }
开发者ID:jorge-lopez,项目名称:Launch,代码行数:7,代码来源:Desarrollador.cs


示例10: IncrementServiceShouldIncrementData

        public void IncrementServiceShouldIncrementData()
        {
            // Arrange
            const int InitialData = 1;
            const int ExpectedData = 2;

            WorkflowServiceTestHost host = null;
            try
            {
                var address = ServiceTest.GetUniqueEndpointAddress();
                using (host = WorkflowServiceTestHost.Open("IncrementService.xamlx", address))
                {
                    var proxy = new ServiceClient(ServiceTest.Pipe, address);
                    int? value = InitialData;
                    proxy.Increment(ref value);
                    Assert.AreEqual(ExpectedData, value, "Increment did not correctly increment the value");
                }

                // The host must be closed before asserting tracking
                // Explicitly call host.Close or exit the using block to do this.

                // Assert that the Assign activity was executed with an argument named "Value" which contains the value 2
                host.Tracking.Assert.ExistsArgValue("Assign", ActivityInstanceState.Closed, "Value", 2);
            }
            finally
            {
                if (host != null)
                {
                    host.Tracking.Trace();
                }
            }
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:32,代码来源:IncrementServiceTest.cs


示例11: Create

		public ActionResult Create(FormCollection collection) {
			try {
				ServiceReference.JediWS jedi = new JediWS();
				List<CaracteristiqueWS> caracList = new List<CaracteristiqueWS>();

				using(ServiceReference.ServiceClient service = new ServiceClient()) {
					service.getCaracteristiques().ForEach(x => {
						if(x.Type == ServiceReference.ETypeCaracteristiqueWS.Jedi) {
							caracList.Add(x);
						}
					});

					/* Item1. sur le champs du jedi parce que on a un tuple */
					jedi.Id = 0; // Car creation
					jedi.Nom = Convert.ToString(collection.Get("Item1.Nom"));
					jedi.IsSith = Convert.ToBoolean(collection.Get("Item1.IsSith") != "false"); // Pour que ca marche bien
					jedi.Caracteristiques = new List<CaracteristiqueWS>(); // Pour init

					string[] checkboxes = collection.GetValues("caracteristiques");
					if(checkboxes != null) {
						foreach(string s in checkboxes) {
							//On a que les ids des box selected, on ajoute les caracteristiques
							Int32 caracId = Convert.ToInt32(s);
							jedi.Caracteristiques.Add(caracList.First(x => x.Id == caracId));
						}
					}

					service.addJedi(jedi); // Ajout du jedi
				}

				return RedirectToAction("Index"); // Retour a l'index
			} catch {
				return RedirectToAction("Index");
			}
		}
开发者ID:BBS007,项目名称:WebServiceJedi,代码行数:35,代码来源:JediController.cs


示例12: InsertGruSysStandort

 public static void InsertGruSysStandort(List<GruSysStandort> List)
 {
     using (WZNTServices.ServiceClient Client = new ServiceClient())
     {
         Client.CreateGruSysStandortList(List.ToArray());
     }
 }
开发者ID:pgemeo,项目名称:WZNT,代码行数:7,代码来源:DbManager.cs


示例13: InsertGruSysAPiJobl

 public static void InsertGruSysAPiJobl(List<GruSysAPiJobl> List)
 {
     using (WZNTServices.ServiceClient Client = new ServiceClient())
     {
         Client.CreateGruSysAPiJoblList(List.ToArray());
     }
 }
开发者ID:pgemeo,项目名称:WZNT,代码行数:7,代码来源:DbManager.cs


示例14: InsertGruArtAufEinzelnutzen

 public static void InsertGruArtAufEinzelnutzen(List<GruArtAufEinzelnutzen> List)
 {
     using (WZNTServices.ServiceClient Client = new ServiceClient())
     {
         Client.CreateGruArtAufEinzelnutzenList(List.ToArray());
     }
 }
开发者ID:pgemeo,项目名称:WZNT,代码行数:7,代码来源:DbManager.cs


示例15: RunAsync

        public async override Task RunAsync(AuthorizationData authorizationData)
        {
            try
            {
                Service = new ServiceClient<ICustomerManagementService>(authorizationData);

                var getUserResponse = await GetUserAsync(null);
                var user = getUserResponse.User;

                // Search for the Bing Ads accounts that the user can access.

                var accounts = await SearchAccountsByUserIdAsync(user.Id);

                // Optionally if you are enabled for Final Urls, you can update each account with a tracking template.
                var accountFCM = new List<KeyValuePair<string, string>>();
                accountFCM.Add(new KeyValuePair<string, string>(
                    "TrackingUrlTemplate",
                    "http://tracker.example.com/?season={_season}&promocode={_promocode}&u={lpurl}"));
                
                OutputStatusMessage("The user can access the following Bing Ads accounts: \n");
                foreach (var account in accounts)
                {
                    OutputAccount(account);

                    // Optionally you can find out which pilot features the customer is able to use. 
                    // Each account could belong to a different customer, so use the customer ID in each account.
                    var featurePilotFlags = await GetCustomerPilotFeaturesAsync((long)account.ParentCustomerId);
                    OutputStatusMessage("Customer Pilot flags:");
                    OutputStatusMessage(string.Join("; ", featurePilotFlags.Select(flag => string.Format("{0}", flag))));
                    
                    // Optionally if you are enabled for Final Urls, you can update each account with a tracking template.
                    // The pilot flag value for Final Urls is 194.
                    if (featurePilotFlags.Any(pilotFlag => pilotFlag == 194))
                    {
                        account.ForwardCompatibilityMap = accountFCM;
                        await UpdateAccountAsync(account);
                        OutputStatusMessage(string.Format("Updated the account with a TrackingUrlTemplate: {0}\n", 
                            accountFCM.ToArray().SingleOrDefault(keyValuePair => keyValuePair.Key == "TrackingUrlTemplate").Value));
                    }
                }
            }
            // Catch authentication exceptions
            catch (OAuthTokenRequestException ex)
            {
                OutputStatusMessage(string.Format("Couldn't get OAuth tokens. Error: {0}. Description: {1}", ex.Details.Error, ex.Details.Description));
            }
            // Catch Customer Management service exceptions
            catch (FaultException<Microsoft.BingAds.CustomerManagement.AdApiFaultDetail> ex)
            {
                OutputStatusMessage(string.Join("; ", ex.Detail.Errors.Select(error => string.Format("{0}: {1}", error.Code, error.Message))));
            }
            catch (FaultException<Microsoft.BingAds.CustomerManagement.ApiFault> ex)
            {
                OutputStatusMessage(string.Join("; ", ex.Detail.OperationErrors.Select(error => string.Format("{0}: {1}", error.Code, error.Message))));
            }
            catch (Exception ex)
            {
                OutputStatusMessage(ex.Message);
            }
        }
开发者ID:BingAds,项目名称:BingAds-dotNet-SDK,代码行数:60,代码来源:SearchUserAccounts.cs


示例16: ObtenerPrimeros10Apps

 public IList<IList<string>> ObtenerPrimeros10Apps()
 {
     using (ServiceClient SCliente = new ServiceClient())
     {
         return SCliente.ObtenerAppsDeveloper(this.Correo);
     }
 }
开发者ID:jorge-lopez,项目名称:Launch,代码行数:7,代码来源:Desarrollador.cs


示例17: buttonSearch_Click

 private void buttonSearch_Click(object sender, EventArgs e)
 {
     try
     {
         string userName = textBoxUserName.Text.Trim();
         if (userName.Equals(string.Empty))
         {
             ZBMMessageBox.ShowInfo("请输入用户名");
             return;
         }
         ServiceClient client = new ServiceClient();
         DataTable dataTable = client.SelectProjectByUser(userName);
         if (dataTable != null)
         {
             if (dataTable.Rows.Count > 0)
             {
                 dataGridViewProject.DataSource = dataTable;
             }
             else
             {
                 ZBMMessageBox.ShowInfo("此用户名下不存在项目");
             }
         }
         else
         {
             ZBMMessageBox.ShowInfo("查找失败");
         }
     }
     catch (Exception ex)
     {
         ExceptionLog.Instance.WriteLog(ex, LogType.UI);
         ZBMMessageBox.ShowError(ex);
     }
 }
开发者ID:ChuckTest,项目名称:WCFTest,代码行数:34,代码来源:FormUserToProject.cs


示例18: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack && !IsCallback)
     {
         service = new BJServiceRef.ServiceClient(new InstanceContext(new emptyCallback()),"HttpBinding");
     }
     if (Session["user"] == null)
         Server.Transfer("~/Default.aspx");
     currentUser = (UserWcf)Session["user"];
     if (!Page.IsCallback && !Page.IsPostBack)
     {
         selectedUser = currentUser;
         if (currentUser.isAdmin)
         {
             users = service.getUsers();
             rbl_users.DataSource = users;
             rbl_users.DataTextField = "Username";
             rbl_users.DataValueField = "Username";
             rbl_users.DataBind();
             Session["userlist"] = users;
         }
         populateFields();
     }
     if (Page.IsPostBack)
     {
         txt_username.Text = selectedUser.Username;
         selectedUser.money = int.Parse(txt_money.Text);
         selectedUser.numOfGames = int.Parse(txt_num_of_games.Text);
         selectedUser.isAdmin = chk_admin.Checked;
         
     }
     
     
     
 }
开发者ID:srgrn,项目名称:BlackJack.Net,代码行数:35,代码来源:UserPage.aspx.cs


示例19: RunAsync

        public async override Task RunAsync(AuthorizationData authorizationData)
        {
            try
            {
                Service = new ServiceClient<ICustomerManagementService>(authorizationData);

                var user = await GetUserAsync(null);

                // Search for the accounts that matches the specified criteria.

                var accounts = await SearchAccountsByUserIdAsync(user.Id);

                PrintAccounts(accounts);
            }
            // Catch authentication exceptions
            catch (OAuthTokenRequestException ex)
            {
                OutputStatusMessage(string.Format("Couldn't get OAuth tokens. Error: {0}. Description: {1}", ex.Details.Error, ex.Details.Description));
            }
            // Catch Customer Management service exceptions
            catch (FaultException<Microsoft.BingAds.CustomerManagement.AdApiFaultDetail> ex)
            {
                OutputStatusMessage(string.Join("; ", ex.Detail.Errors.Select(error => string.Format("{0}: {1}", error.Code, error.Message))));
            }
            catch (FaultException<Microsoft.BingAds.CustomerManagement.ApiFault> ex)
            {
                OutputStatusMessage(string.Join("; ", ex.Detail.OperationErrors.Select(error => string.Format("{0}: {1}", error.Code, error.Message))));
            }
            catch (Exception ex)
            {
                OutputStatusMessage(ex.Message);
            }
        }
开发者ID:moinahmed,项目名称:BingAds-dotNet-SDK,代码行数:33,代码来源:SearchUserAccounts.cs


示例20: GameBoardWPF

        public GameBoardWPF(int gameId, int size, string gameOption, Player player1, Player player2, bool confirmationRequired)
        {
            c = new ServiceClient(new InstanceContext(this));
            this.boardSize = size;
            this.gameId = gameId;
            this.gameOption = gameOption;
            this.player1 = player1;
            this.player2 = player2;
            this.confirmationRequired = confirmationRequired;
            InitializeComponent();
            computerOrPlayer = gameOption;
            currenTurn = "player1";

            buttons1 = CreateButtons();
            buttons2 = CreateButtons();

            initGrid();

            if (!computerOrPlayer.Equals("computer") && !confirmationRequired) // if vs player - we need the other player to confirm the duel
            {
                busyIndicator.IsBusy = true;
                c.AskPlayerConfirmation(size,player1, player2,true,gameId);

            }
        }
开发者ID:andychas,项目名称:TicTacToe,代码行数:25,代码来源:GameBoardWPF.xaml.cs



注:本文中的ServiceClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ServiceCollection类代码示例发布时间:2022-05-24
下一篇:
C# ServiceCallOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap