c# - webservice calculate sum in console app? -
not sure if able understand here code:
case 1: double[] myarrai1 = new double[3]; console.foregroundcolor = consolecolor.yellow; console.backgroundcolor = consolecolor.darkgray; console.writeline("*-------------------------------------------------------* "); console.writeline("* enter array of numbers sum total * "); console.writeline("*-------------------------------------------------------* "); console.writeline("insert number"); myarrai1[0] = double.parse(console.readline()); console.writeline("insert number"); myarrai1[1] = double.parse(console.readline()); console.writeline("insert number"); myarrai1[2] = double.parse(console.readline()); drawstarline(); foreach (double d in myarrai1) console.writeline( d ); webservices09004961.servicereference1.calculatesumrequest array = new servicereference1.calculatesumrequest(); //servicereference1.calculatesumrequest array = new servicereference1.calculatesumrequest(); webservices09004961.servicereference1.arrayofdouble arrayofdoubles = new webservices09004961.servicereference1.arrayofdouble(); //calculatesumoflist.servicereference1.service1soapclient client = new calculatesumoflist.servicereference1.service1soapclient(); //calculatesumoflist.servicereference1.arrayofdouble arrayofdoubles = new calculatesumoflist.servicereference1.arrayofdouble(); arrayofdoubles.addrange(myarrai1); double e = array.calculatesum(arrayofdoubles); //error on line calculatesum? console.writeline("=" + e); console.readline(); break;
i store 3 user input numbers in myarrai1 "sum" sum have made webreference calculatesumoflist.
but says webreference not contain calculatesum in webservice, yet , im using in windows forms within same build/project?
thanks.
so trial , error had realised calling client first time round used webservice.
case 1: double[] myarrai1 = new double[3]; console.foregroundcolor = consolecolor.yellow; console.backgroundcolor = consolecolor.darkgray; console.writeline("*-------------------------------------------------------* "); console.writeline("* enter array of numbers sum total * "); console.writeline("*-------------------------------------------------------* "); console.writeline("insert number"); myarrai1[0] = double.parse(console.readline()); console.writeline("insert number"); myarrai1[1] = double.parse(console.readline()); console.writeline("insert number"); myarrai1[2] = double.parse(console.readline()); drawstarline(); foreach (double d in myarrai1) console.writeline( d ); webservices09004961.servicereference1.service1soapclient client2 = new servicereference1.service1soapclient(); webservices09004961.servicereference1.arrayofdouble arrayofdoubles = new webservices09004961.servicereference1.arrayofdouble(); arrayofdoubles.addrange(myarrai1); string e = client2.calculatesum(arrayofdoubles); console.writeline("=" + e); console.readline(); break;
so sum (no pun intended) have spent 5 hours watching , reading tutorials or used abit of trial , error of so!
Comments
Post a Comment