web service return value is a class

Discussion in 'ASP .Net Web Services' started by douglas wittner, Jul 2, 2006.

  1. afternoon, i was hoping someone could offer up some advice.

    i have a client and web service.

    the client is consumed by a web site. the client contacts the web service
    for a result this is a class.

    this class instance coming back is in a library as so all can have access to
    the types used.

    the client is returned a "SOLUTIONClient.localhost.SOLUTIONOutput" object.
    the client understnad this well and there is no problem.

    i would like the web site consuming the client to not have to know about the
    web service. the web site understands
    SOLUTIONOutput vcResult

    can i return a SOLUTIONOutput from the web service and not a
    SOLUTIONClient.localhost.SOLUTIONOutput?

    doug
     
    douglas wittner, Jul 2, 2006
    #1
    1. Advertising

  2. douglas wittner

    Guest

    Hallo now I understand what do you need (little complicated question),
    This is a common problem and this by my opinion is not easily possible.
    In fact, the essential of webservice is creating proxy object, and this
    proxy object is different from another, even if this has the same type.
    And by my opinion you cannot convert either implicitly, or explicitly
    type from one type (somewhere in type-tree) to another, even if this
    has the same name, or the same members/definition.
    I use for solution of this cases XmlSerialization and deserialization,
    like this:
    (warning, this is not complete code)
    stream = XmlDeserizer(WebServiceTypeName)
    classInstance = (classType)XmlSerializer(stream).
    This combination does conversion from webservice proxy into your-class
    same type.

    cheers, Martin

    douglas wittner wrote:
    > afternoon, i was hoping someone could offer up some advice.
    >
    > i have a client and web service.
    >
    > the client is consumed by a web site. the client contacts the web service
    > for a result this is a class.
    >
    > this class instance coming back is in a library as so all can have access to
    > the types used.
    >
    > the client is returned a "SOLUTIONClient.localhost.SOLUTIONOutput" object.
    > the client understnad this well and there is no problem.
    >
    > i would like the web site consuming the client to not have to know about the
    > web service. the web site understands
    > SOLUTIONOutput vcResult
    >
    > can i return a SOLUTIONOutput from the web service and not a
    > SOLUTIONClient.localhost.SOLUTIONOutput?
    >
    > doug
     
    , Jul 3, 2006
    #2
    1. Advertising

  3. martin...i first thank you and commend you on UNDERSTANDING MY PROBLEM lol.
    i was hard to describe for me without more experience.

    and of course, thank you for your answer. i will try it.

    doug

    <> wrote in message
    news:...
    > Hallo now I understand what do you need (little complicated question),
    > This is a common problem and this by my opinion is not easily possible.
    > In fact, the essential of webservice is creating proxy object, and this
    > proxy object is different from another, even if this has the same type.
    > And by my opinion you cannot convert either implicitly, or explicitly
    > type from one type (somewhere in type-tree) to another, even if this
    > has the same name, or the same members/definition.
    > I use for solution of this cases XmlSerialization and deserialization,
    > like this:
    > (warning, this is not complete code)
    > stream = XmlDeserizer(WebServiceTypeName)
    > classInstance = (classType)XmlSerializer(stream).
    > This combination does conversion from webservice proxy into your-class
    > same type.
    >
    > cheers, Martin
    >
    > douglas wittner wrote:
    >> afternoon, i was hoping someone could offer up some advice.
    >>
    >> i have a client and web service.
    >>
    >> the client is consumed by a web site. the client contacts the web service
    >> for a result this is a class.
    >>
    >> this class instance coming back is in a library as so all can have access
    >> to
    >> the types used.
    >>
    >> the client is returned a "SOLUTIONClient.localhost.SOLUTIONOutput"
    >> object.
    >> the client understnad this well and there is no problem.
    >>
    >> i would like the web site consuming the client to not have to know about
    >> the
    >> web service. the web site understands
    >> SOLUTIONOutput vcResult
    >>
    >> can i return a SOLUTIONOutput from the web service and not a
    >> SOLUTIONClient.localhost.SOLUTIONOutput?
    >>
    >> doug

    >
     
    douglas wittner, Jul 5, 2006
    #3
  4. douglas wittner

    Dale Guest

    You might find my series at
    http://www.dalepreston.com/Blog/2005/02/returning-custom-classes-from-web.html
    interesting as it describes several options for sharing objects between a web
    service and client.

    HTH

    Dale
    --
    Dale Preston
    MCAD C#
    MCSE, MCDBA


    "douglas wittner" wrote:

    > martin...i first thank you and commend you on UNDERSTANDING MY PROBLEM lol.
    > i was hard to describe for me without more experience.
    >
    > and of course, thank you for your answer. i will try it.
    >
    > doug
    >
    > <> wrote in message
    > news:...
    > > Hallo now I understand what do you need (little complicated question),
    > > This is a common problem and this by my opinion is not easily possible.
    > > In fact, the essential of webservice is creating proxy object, and this
    > > proxy object is different from another, even if this has the same type.
    > > And by my opinion you cannot convert either implicitly, or explicitly
    > > type from one type (somewhere in type-tree) to another, even if this
    > > has the same name, or the same members/definition.
    > > I use for solution of this cases XmlSerialization and deserialization,
    > > like this:
    > > (warning, this is not complete code)
    > > stream = XmlDeserizer(WebServiceTypeName)
    > > classInstance = (classType)XmlSerializer(stream).
    > > This combination does conversion from webservice proxy into your-class
    > > same type.
    > >
    > > cheers, Martin
    > >
    > > douglas wittner wrote:
    > >> afternoon, i was hoping someone could offer up some advice.
    > >>
    > >> i have a client and web service.
    > >>
    > >> the client is consumed by a web site. the client contacts the web service
    > >> for a result this is a class.
    > >>
    > >> this class instance coming back is in a library as so all can have access
    > >> to
    > >> the types used.
    > >>
    > >> the client is returned a "SOLUTIONClient.localhost.SOLUTIONOutput"
    > >> object.
    > >> the client understnad this well and there is no problem.
    > >>
    > >> i would like the web site consuming the client to not have to know about
    > >> the
    > >> web service. the web site understands
    > >> SOLUTIONOutput vcResult
    > >>
    > >> can i return a SOLUTIONOutput from the web service and not a
    > >> SOLUTIONClient.localhost.SOLUTIONOutput?
    > >>
    > >> doug

    > >

    >
    >
    >
     
    Dale, Jul 9, 2006
    #4
    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. Mythran
    Replies:
    1
    Views:
    628
    Mythran
    Aug 24, 2005
  2. Greenhorn
    Replies:
    15
    Views:
    849
    Keith Thompson
    Mar 6, 2005
  3. MisterEd
    Replies:
    5
    Views:
    201
    Dino Chiesa [Microsoft]
    Oct 28, 2004
  4. johntallon

    Using a Class Factory to Return a Web Service

    johntallon, Nov 17, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    130
    Vishakha
    Nov 21, 2005
  5. Leo Violette
    Replies:
    0
    Views:
    1,068
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page