void Window5_Loaded(object sender, RoutedEventArgs e) { MyWebService.MyServiceSoapClient myservice = new MyServiceSoapClient(); ArrayOfString names=myservice.GetNames(); lBox.ItemsSource = names; //throw new NotImplementedException(); }
protected void AddNumber(object Sender, EventArgs E) { int Num1, Num2; //int.TryParse(txtFirstNum.Value, out Num1); int.TryParse(Text1.Value, out Num1); int.TryParse(Text2.Value, out Num2); // creating object of MyService proxy class var ObjMyService = new MyServiceSoapClient(); // Invoke service method through service proxy divSum.InnerHtml = ObjMyService.SumOfNums(Num1, Num2).ToString(); var ObjSumClass = new SumClass { First = Num1, Second = Num2 }; var ObjSerializer = new JavaScriptSerializer(); var JsonStr = ObjSerializer.Serialize(ObjSumClass); divSumThroughJson.InnerHtml = ObjMyService.SumOfNumsVTwo(JsonStr).Sum.ToString(); //ObjMyService.GetSumThroughObject(JsonStr).Sum.ToString(); //ObjMyServiceProxy.GetSumThroughObject(JsonStr).Sum.ToString(); }