Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2006, 11:38 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing an argument to a web service from a client

Hi Guys,

I am working with visual studio 2005 and I have created a website
project. In that I have created and added a new web service and C# is the language I am using to code. I then created a reference to the webservice (add a web reference) called 'localhost'. There are no build errors in the web service and I am able to run it by itself.

My web service takes an array of type double[][] and returns an array of a custom type, Student, which I have defined as a separate class.

Here is some of the relevant code from the default.aspx page:

-------------------------------------------------------------------
localhost.WebService ws = new localhost.WebService(); //get reference
to web service

double [][] myArray = new double[3][]; //declare an array to pass to web service method
myArray[0] = new double[3] {2.9, 1200, 0};
myArray[1] = new double[3] {3.7, 1400, 1};
myArray[2] = new double[3] {3.5, 1250, 0};

studentArray = ws.StudentResults(myArray); //call a method on the webservice

-----------------------------------------------------------------------
I get an error when I try to run this code.

I noticed that if I defined the myArray within the web service then it ran fine. But in this case I need to collect the data from the front-end (aspx page) and pass it as a parameter to the web service.

Can any one please provide any information that would help resolve this.

Thanks in advance.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Axis web service from .NET client Koushik .NET Web Services 4 April 2nd, 2010 09:16 PM
C# client for SOAP::Lite web service wirespring C# 0 December 8th, 2006 07:14 PM
passing a page into a web service as a byref param jonny75904 ASP.NET 1.0 and 1.1 Professional 0 August 15th, 2006 04:08 PM
Web Service Client VandanaD J2EE 0 February 13th, 2006 09:45 PM
Web Service Vs. Client/Server gabrielboys .NET Web Services 10 January 10th, 2006 06:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.