Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > web service return value is a class

Reply
Thread Tools

web service return value is a class

 
 
douglas wittner
Guest
Posts: n/a
 
      07-02-2006
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


 
Reply With Quote
 
 
 
 
Martin.Kunc@gmail.com
Guest
Posts: n/a
 
      07-03-2006
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


 
Reply With Quote
 
 
 
 
douglas wittner
Guest
Posts: n/a
 
      07-05-2006
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

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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

>



 
Reply With Quote
 
Dale
Guest
Posts: n/a
 
      07-08-2006
You might find my series at
http://www.dalepreston.com/Blog/2005...-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
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > 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

> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM
WS Consumption: CType a return value of class to original class MisterEd ASP .Net Web Services 5 10-28-2004 09:54 PM



Advertisments