当前位置: 首页>>代码示例>>C#>>正文


C# ServiceClient类代码示例

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


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


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