Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   custom serialization with SoapExtension (http://www.velocityreviews.com/forums/t786673-custom-serialization-with-soapextension.html)

Frederik Vanderhaegen 10-26-2006 07:37 PM

custom serialization with SoapExtension
 
Hi,

I'm writing a webservice which returns a custom object, e.g. public Broker
GetBrokerById(int BrokerId){ //some code }.
My problem is the following, the broker object can't be marked serializable
because there would be problems with other applications using this class.
So I thought to write a SoapExtension which de/serializes the object by the
use of a class that implements the ISerializationSurrogate interface.
I'm able to de/serialize the object with the surrogate class but the
problems start when I have to implement it into the ProcessMessage method.
If the message is a ServerSoapMessage, I retrieve the ReturnValue is the
BeforeSerialize stage, save it in a temp memory stream and in the
AfterSerialize I replace the outgoing stream (because it contains an error
message saying that the object isn't serializable) by the temp memory
stream.
The client receives the SoapMessage perfect, I can deserialize it but I
don't know how I can pass it back to the function who made the request.
Does anyone know how I can realize this?
Or is this the wrong way to accomplish this?

Any help is welcome

Thanks in advance

Frederik




All times are GMT. The time now is 08:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.