Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:19:30+00:00 2026-06-05T01:19:30+00:00

I am working on an assignment and I am getting this error which I

  • 0

I am working on an assignment and I am getting this error which I don’t understand. I am writing a WCF client for a working service. Can anyone help me out here?

This line is throwing the error:

MyComplex sumcplx = proxy.complex_sum(one,two);

Error I get

Error: The best overloaded method match for ‘NETProxyWCFClient.ProxyTypes.CalculatorClient.complex_sum(NETProxyWCFClient.ProxyTpes.MyComplex,NETProxyWCFClient.ProxyTpes.MyComplex)’ has some invalid arguments

Code to my program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.ServiceModel.Description;

namespace NETProxyWCFClient
{
    [DataContract]
    public class MyComplex
    {
        int real;
        [DataMember]
        public int Real
        {
            get { return real; }
            set { real = value; }
        }
        [DataMember]
        int im;
        public int Im
        {
            get { return im; }
            set { im = value; }
        }

    }
    [ServiceContract]
    interface ICalculator
    {
        [OperationContract]
        int mult(int a, int b);

        [OperationContract]
        List<int> fib(int n);

        [OperationContract]
        MyComplex complex_sum(MyComplex a, MyComplex b);
    }
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter in 2 numbers");
            string read = Console.ReadLine();
            string[] numbers = read.Split(' ');
            int m = int.Parse(numbers[0]);
            int n = int.Parse(numbers[1]);

            ProxyTypes.CalculatorClient proxy = new ProxyTypes.CalculatorClient();


            //Multiplcation
            int sum = proxy.mult(m, n);
            Console.WriteLine(sum.ToString());


            //Mycomplex
            MyComplex one = new MyComplex();
            one.Im = m;
            one.Real = n;

            MyComplex two = new MyComplex();
            two.Im = n;
            two.Real = m;

            MyComplex sumcplx = proxy.complex_sum(one,two);
            Console.WriteLine(sumcplx.Im + " , " + sumcplx.Real);

            //fib one
            int[] listM = proxy.fib(m);
            foreach (int listItem in listM)
            {
                Console.Write(listItem.ToString() + " ");
            }
            Console.WriteLine("");

            //fib 2
            int[] listN = proxy.fib(n);
            foreach (int listItem in listN)
            {
                Console.Write(listItem.ToString() + " ");
            }

            Console.ReadLine();




        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:19:31+00:00Added an answer on June 5, 2026 at 1:19 am

    If you have Added a service reference to your test program, there is a proxt class that is generated for you, so if you have ICalculator defined explicity (code you wrote) remove it. it is already in your project, under the NETProxyWCFClient.ProxyTpes.MyComplex,NETProxyWCFClient.ProxyTpes namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error in several methods for several variables (all of which are
Could anyone shed any light as to why I can get this working. I
I am working on a date validation (MM/DD/YYYY) and getting this error: error: lvalue
I'm working on my assignment of PHP course. The problem that I don't understand
I've been working on this assignment, where I need to read in records and
I'm working on a homework assignment in which I'm required to use char arrays
I am working on this assignment. I need to create a temporary stack without
For a class assignment, we are writing a custom syscall which pulls certain information
I'm working on a assignment for class so this is only part of the
I'm currently working on a program (for fun, this is not an assignment) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.