|
/// <summary> /// MyClientService is the client side class /// It is actually the client webservice class /// Console application /// </summary> class MyClientService { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { try { //TestWS is the web reference to TestWebService TestWS.MyWebService MyWS=new TestWS.MyWebService(); //set values for authentication properties TestWS.Authentication MyAuthorization=new TestWS.Authentication(); MyAuthorization.Client_Id=123456; MyAuthorization.Client_Code="abc123"; MyAuthorization.Client_Token="XDEVGFG-jjgfgfg-1264644-hfgfgfg"; MyWS.AuthenticationValue=MyAuthorization;
//Create a new employee object TestWS.Employee oEmpl = new TestWS.Employee(); oEmpl.SSN="145-547-8745"; oEmpl.FirstName="James"; oEmpl.LastName="Madison"; // //Create a new enmployee bool bSuccess=MyWS.Process_NewEmployee(oEmpl); if (! bSuccess) { //Log error processing new employee message return; } //Update employee benefits oEmpl.HasMedical=true; oEmpl.HasDental=true; oEmpl.HasVision=false;
//Process employee benefit bSuccess=MyWS.Process_EmployeeBenefit(oEmpl); if (! bSuccess) { //Log error processing employee benefit message return; } //Update employee payroll oEmpl.Salary=50000; oEmpl.Vacation=12; //Process employee payroll information bSuccess=MyWS.Process_EmployeePayroll(oEmpl); if (! bSuccess) { //Log error processing employee payroll message return; } } catch (Exception ex) { //Log error message return; } } }
|