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 7629657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:53:26+00:00 2026-05-31T05:53:26+00:00

So I managed to use SOAP no problem but I am having difficulty using

  • 0

So I managed to use SOAP no problem but I am having difficulty using WCF to do the same job.

My application takes a list of numbers then sums them using a webservice, I can successfuly do this using SOAP but now I am running into trouble trying it with WCF.

        Webservices09004961.ServiceReference1.Service1SoapClient SumCLient = new ServiceReference1.Service1SoapClient();
        Webservices09004961.ServiceReference2.IService1 SumClientWCF = new ServiceReference2.Service1Client();

Notice that I call the client method the same way this seems fine.

However when I try the same method I cannot seem to call ArrayOfDoubles like my previous method using soap:

        Webservices09004961.ServiceReference2.Service1Client arrayOfdoubles = new ServiceReference2.Service1Client(); //this line is wrong but I tryed it anyway
        //Webservices09004961.ServiceReference1.ArrayOfDouble arrayOfDoubles = new Webservices09004961.ServiceReference1.ArrayOfDouble(); 
        arrayOfDoubles.AddRange(myArrai12);
        string f = SumCLientWCF.CalculateSum(arrayOfDoubles);
        Console.WriteLine("The sum total equals: " + f);

My problem I fear lies in my wcf method, Service1.svc.cs looks like this:

namespace WcfSum
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        public string CalculateSum(List<double> listDouble)
        {
            return listDouble.Sum().ToString();

             //return listDouble.Select(n => (double)n).ToString();

        }
    }
}

This seems fine to me? My IService tho may be the problem this is all I have for it:

namespace WcfSum
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        string CalculateSum(List<double> listDouble);

    }

Normally I would expect once I type Myservice.ServiceReference1. arrayofdoubles would come up but I dont have that option this time the only option I am getting is Service1 or serviceclient.

EDIT

To clarifify abit more because I use this method (because ArrayOfDoubles isnt there like with my soap version commented out)

    Webservices09004961.ServiceReference2.Service1Client arrayOfdoubles = new ServiceReference2.Service1Client(); //this line is wrong but I tryed it anyway
    //Webservices09004961.ServiceReference1.ArrayOfDouble arrayOfDoubles = new Webservices09004961.ServiceReference1.ArrayOfDouble(); 

I get the error message:

Error   1   'Webservices09004961.ServiceReference2.Service1Client' does not contain a definition for 'AddRange' and no extension method 'AddRange' accepting a first argument of type 'Webservices09004961.ServiceReference2.Service1Client' could be found (are you missing a using directive or an assembly reference?)

On this line under AddRange.

arrayOfdoubles.AddRange(myArrai12);

Im struggling to find out why:

Webservices09004961.ServiceReference2. wont show ArrayOfDoubles Like it does with my soap version.

This might help show whats going on:

enter image description here

  • 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-05-31T05:53:28+00:00Added an answer on May 31, 2026 at 5:53 am

    OK, some fixes:

        var arrayOfdoubles = new ServiceReference2.Service1Client(); 
        var inputData = new List<double> { 1.1, 2.2 };
        string f = arrayOfdoubles.CalculateSum(inputData);
        Console.WriteLine("The sum total equals: " + f);
    

    Obviously arrayOfdoubles is not a very good name (it’s the client proxy) but I left it as a reference to your code.

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

Sidebar

Related Questions

I've managed to use Sun's MSCAPI provider in my application. The problem I'm having
I am using KSOAP2 to manage SOAP in Android but it use https for
How to make use of jndi in a stand-alone (non-managed) application? App and Tomcat6
I've been using the Semaphore class to create semaphores. However, the examples use managed
I'm having more problem with JSON! I am using the advice from this article
Has anyone managed to use core-plot from wax? I have been trying recently, but
I'm trying to learn how to use managed/unmanaged code interop, but I've hit a
I'd like to use Subsonic in a shopping cart application, but I'm trying to
New to Entity Framework .Using EF4. I have found articles and managed to use
I managed to use jEditable selects, inputs and textareas quite easily, but I have

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.