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

The Archive Base Latest Questions

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

I have the following web service function- [ServiceContract] public interface ITest { [OperationContract] double

  • 0

I have the following web service function-

    [ServiceContract]
public interface ITest
{
    [OperationContract]
    double Sum(double a, double b);

}
public class Test : ITest
{
    public double Sum(double a, double b)
    {
        double answer = a + b;
        return answer;
    }

And I am implementing it using this –

        double a = double.Parse(textBox1.Text);
        double b = double.Parse(textBox2.Text);
        double sum = sc.Sum(a, b);

My problem being this only handles two doubles, how could I get it to handle several from just one text box, i.e. 1,2,3,4 with the response being 10?

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

    If it wasn’t a web service you could use a special keyword params, like

    public double Sum(params double[] items)
    {
        //do sum
        return answer;
    }
    

    But web services don’t know what params means so you would need to use something like List<double> or double[], e.g.

    public double Sum(List<double> items)
    {
        return items.Sum();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xml that's sent to me from a web service. I'm
Suppose I have the following (rather common) model Client invokes web service request ->
I have the following web service call: <cfinvoke webservice=#application.capsRemote#card.cfc?wsdl method=purchase returnVariable=retpurchase refreshwsdl=true> <cfinvokeargument name=iCustomer
I have the following web-service which works perfectly as long as it is accessed
I have the following jquery which reads from the excellent geonames.org web service: $('#<%=txtFindMyCity.ClientID%>').autocomplete(http://ws.geonames.org/searchJSON,
I have created a web service for the following code but I am getting
I have an web service named AEWService.asmx with the following code: using System; using
I have the following JSON coming back from a web service which I am
I have the following web config file. I am having some difficulty in retrieving
Say I have the following web.config: <?xml version=1.0 encoding=utf-8?> <configuration> <system.web> <authentication mode=Windows></authentication> </system.web>

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.