ASP.NET Web Service newbie question

Discussion in 'ASP .Net' started by Hitesh Kanwathirtha, Mar 9, 2006.

  1. 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

    --

    -Hitesh Kanwathirtha ()
    Hitesh Kanwathirtha, Mar 9, 2006
    #1
    1. Advertising

  2. Hitesh Kanwathirtha

    Mark Guest

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

    "Hitesh Kanwathirtha" <> wrote in message
    news:...
    > 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
    >
    > --
    >
    > -Hitesh Kanwathirtha ()
    Mark, Mar 9, 2006
    #2
    1. Advertising

  3. Hitesh Kanwathirtha

    SarahJ

    Joined:
    Jul 4, 2006
    Messages:
    1
    I am experiencing the same problem. Did you arrive at a solution?
    SarahJ, Jul 4, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Navin Mishra
    Replies:
    4
    Views:
    385
    =?Utf-8?B?UGVyc2hpbmc=?=
    Oct 20, 2006
  2. WTH
    Replies:
    1
    Views:
    167
  3. Navin Mishra
    Replies:
    1
    Views:
    106
    sonic
    Aug 25, 2006
  4. Leo Violette
    Replies:
    0
    Views:
    1,017
    Leo Violette
    Apr 17, 2009
  5. jazzydance

    asp.net web service connecting to another web service

    jazzydance, Feb 7, 2010, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    808
    Mr. Arnold
    Feb 8, 2010
Loading...

Share This Page