web service return value is a class

  • Thread starter douglas wittner
  • Start date
D

douglas wittner

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
 
M

Martin.Kunc

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
 
D

douglas wittner

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
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top