ASP.NET Web Service newbie question

  • Thread starter Hitesh Kanwathirtha
  • Start date
H

Hitesh Kanwathirtha

Apologies in advance if this is a stupid question but I'm
just starting to learn ASP.NET.
So I have a bunch of classes that are in a class library.
One of them happens to be a Tree class. Now, I wish to have
a WebMethod (lets call it foo) which takes in this Tree class
as a parameter. I added a reference to the DLL which contains
the class library and just made the parameter for foo.
The WebService project built without any errors.
Now, in the client side code consuming the service, I added a
reference to the exact same DLL. I also added a reference to
the WebService, and did a call to foo, passing in the tree.
However, this code doesn't compile, as it seems to be expecting
a different type of tree. My understanding is it expects an object
of Tree that is defined in the wsdl file generated. Casting
between the two trees doesn't help either.

I'm not sure what to do here. I can't seem to convince the C#
compiler that the Tree type that foo wants is the same as the
one that I'm giving it.
I'm pretty sure I'm in this pickle because of my lack of
understanding of how web services work, so any help would be
greatly appreciated.

Thanks,
Hitesh
 
M

Mark

Have you thought of using late binding and just passing in an object instead
of an explicit reference to your tree object?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top