custom serialization with SoapExtension

  • Thread starter Frederik Vanderhaegen
  • Start date
F

Frederik Vanderhaegen

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
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top