|
Mailing Lists
|
Home /
Groups /
.NET Technical Talk (Net-Talk)
Newbie question
Author: G
Short Link: http://www.houseoffusion.com/groups/net-talk/thread.cfm/threadid:1714#5387
Hi guys, I have an amateurish question here that I'm frustrated I don't know
the answer too. Let me spell it out.
I have a class that is exposed as a webservice as such:
[Webservice (Namespace = "http://myurl.com <http://myurl.com/> ")]
public class MyClass
{
Public struct dataStruct
{
Public string dataName;
Public string dataValue;
}
Public List<dataStruct> myMethod(List<dataStruct>
inputDataStruc)
{
//code
//code
}
}
The webmethod has a member that is a simple structure (dataStruct). It
contains a method (myMethod) that accepts a generic List of dataStructs.
When I consume this method, and attempt to make use of the myMethod, I will
need to pass in a parameter of type List<dataStruct>, and it is here that I
am stuck.
In the calling class, how do I instantiate a variable of type
List<dataStruct> so that I can pass it into the method? I think I need to
create an object in the MyClass of type List<dataStruct> and instantiate it
in the Constructor, so that when I create a MyClass object, I will have
access to the dataStruct type, but that didn't seem to work (possibly
because I was doing I wrong).
Thanks in advance for anyone who can both follow this, and help me out!!!
:-)
Brian
|
May 24, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||