Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I connected it to the WPF Form Application C # project with the WCF Service Library. I added the service reference and I invoked add

I connected it to the WPF Form Application C # project with the WCF Service Library. I added the service reference and I invoked add, sub, mul. But I got three errors in WCFMainwindow.xaml.cs page (add, sub, mul). (I drew where the error was with the arrow.) If that part is written incorrectly, you can change it. I would be glad if you could help. Please explain.

The project I am using is WPF Form Application C #.

ERROR EXPLANATION:

***Service1Client' does not contain an 'add' definition and no accessible 'add' extension method was found accepting a first argument of type 'Service1Client' (could your use directive or compile reference be missing?)

***'Service1Client' does not contain a 'sub definition, and no accessible' sub 'extension method was found that accepts a first argument of type' Service1Client '(may your use directive or compile reference be missing?)

***'Service1Client' does not contain a 'mul' definition and no accessible 'mul' extension method was found that accepts a first argument of type 'Service1Client' (might your use-directive or compile reference be missing?)

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Service1.cs IService1.cs WCFMainWindow.xaml.cs* WCFMainWindow.xaml* + x WCFMainWindow Simple Calculator "A" value "B" value ADD Sub Mul Clear t OO 100% Tasarm Window 17 18 19 20 21 - WCFServis.IService1 add(double vala, double valB) Service1.cs* IService1.cs* + x WCFMainWindow.xaml.cs* WCFMainWindow.xaml* C# WCFServis 1 Pusing System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Runtime. Serialization; 5 using System.ServiceModel; 6 using System.Text; 7 8 namespace WCFServis 9 { 10T 11 [ServiceContract] 1 bavuru 12 public interface IService1 13 14 /* [OperationContract] 15 string GetData(int value); 16 17 18 [OperationContract] 1 bavuru 19 double add(double vald, double valB); 20 21 [OperationContract] 1 bavuru 22 double sub(double vald, double valB); 23 24 [OperationContract] 1 bavuru 25 double mul(double vala, double vale); 26 27 28 29 WCFMainWindow.xaml* WCFServis.Service1 add(double valA, double valB) Service1.cs* + x Service1.cs* WCFMainWindow.xaml.cs* C# WCFServis Dusing System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System. Runtime. Serialization; 5 using System.ServiceModel; 6 using System.Text; namespace WCFServis 9 10 O bavuru public class Service1 : IService1 11 12 13 14 /*public string GetData(int value) { return string.Format("You entered: {@}", value); 16 17 18 */ 19 1 bavuru public double add(double vald, double valB) { return valA + valB; 21 22 1 bavuru public double sub(double vala, double valB) return valA - valB; 26 1 bavuru public double mul(double vald, double valB) 27 28 29 return valA * valB; 31 32 ..Cirbtn_Click(object sender, RoutedEventArgs e) Service1.cs IService1.cs WCFMainWindow.xaml.cs* + x WCFMainWindow.xaml* C# RoutedEventHandling RoutedEventHandling. WCFMainWindow 7 using System.Windows. Documents; 8 using System.Windows. Input; 9 using System.Windows.Media; 10 using System.Windows.Media. Imaging; 11 using System.Windows.Shapes; 12 using System.Threading.Tasks; 13 14 Enamespace RoutedEventHandling 15 { 16 /// 17 /// WCFMainWindow.xaml etkileim mant 18 /// 2 bavuru 19 public partial class WCFMainWindow : Window 20 21 ServiceReference1.Service1client client = new ServiceReference1.Service1client(); 22 O bavuru public WCFMainWindow() { InitializeComponent(); 1 bavuru private void ClrBtn_Click(object sender, RoutedEventArgs e) 28 valueA.Text = valueB.Text = Result.Text = ""; 30 31 32 } 33 1 bavuru private void AddBtn_Click(object sender, RoutedEventArgs e) I 34 35 36 37 Result.Text = client.add(Convert.ToDouble(valueA.Text), Convert.ToDouble(valueB.Text)).ToString(); } 38 39 40 1 bavuru private void SubBtn_Click(object sender, RoutedEventArgs e) { Result.Text = client.sub(Convert.ToDouble(valueA.Text), Convert.ToDouble(valueB.Text)).ToString(); } I 41 42 1 bavuru 43 private void MulBtn_Click(object sender, RoutedEventArgs e) 44 45 Result.Text = client.mul(Convert.ToDouble(valueA.Text), Convert.ToDouble(valueB.Text)).ToString(); 46 47 48 107 % 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago