custom serialization with SoapExtension

Discussion in 'ASP .Net Web Services' started by Frederik Vanderhaegen, Oct 26, 2006.

  1. 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
    Frederik Vanderhaegen, Oct 26, 2006
    #1
    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. fred carter

    SoapExtension & Http headers

    fred carter, Apr 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    785
    fred carter
    Apr 2, 2004
  2. Replies:
    8
    Views:
    2,235
    deadsea
    Jan 2, 2005
  3. Replies:
    3
    Views:
    1,023
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    776
    Dimitri Ognibene
    Sep 2, 2006
  5. Ramunas Urbonas
    Replies:
    1
    Views:
    391
    Dino Chiesa [Microsoft]
    Jul 27, 2004
Loading...

Share This Page