avoiding deserialization

Discussion in 'ASP .Net Web Services' started by sean rogers, Aug 15, 2006.

  1. sean rogers

    sean rogers Guest

    hi

    1. i have a biztalk orchestration that calls my web service.
    2. My web service receives the BTS message and deserializes it
    3. My webservice then takes the deserialized object and re-serializes it
    into an XmlDocument before sending it to another component to be processed.

    My question is - is there anyway to remove step 2 - the unnecessary
    deserialization from the BTS message into my object.

    Can i hack the deserialization code out of the webservice?

    thanks
     
    sean rogers, Aug 15, 2006
    #1
    1. Advertising

  2. sean rogers

    Josh Twist Guest

    You could just change your web service to accept an XmlDocument
    parameter instead of the objects that represent it. However, I really
    wouldn't advise you to do this as it's as non web service'y' as using a
    dataset:
    http://www.thejoyofcode.com/SOA_and...ervice_interfaces_are_the_spawn_of_Satan.aspx

    I guess you're probably looking to do this because you're worried about
    performance but I really wouldn't unless you're actually having
    performance problems. Otherwise it's premature optimisation:
    http://www.thejoyofcode.com/Premature_Optimisation.aspx

    If possible - I'd try and change the 'other' component to take an
    object and not an XmlDocument and do away with serialization until you
    hit the wire. Though, I realise this might not be possible if the
    component is legacy and/or not yours. Good luck!

    Josh
    http://www.thejoyofcode.com/

    sean rogers wrote:
    > hi
    >
    > 1. i have a biztalk orchestration that calls my web service.
    > 2. My web service receives the BTS message and deserializes it
    > 3. My webservice then takes the deserialized object and re-serializes it
    > into an XmlDocument before sending it to another component to be processed.
    >
    > My question is - is there anyway to remove step 2 - the unnecessary
    > deserialization from the BTS message into my object.
    >
    > Can i hack the deserialization code out of the webservice?
    >
    > thanks
     
    Josh Twist, Aug 17, 2006
    #2
    1. Advertising

  3. sean rogers

    sean rogers Guest

    thanks for your reply and your pragmatism. Its not exactly the awnser i was
    looking for.

    I have heard about intercepting the data stream before it reaches the
    webservice - and so keeping it in its Xml format.
    Just wondered if anyone had some code to do it.


    "Josh Twist" wrote:

    > You could just change your web service to accept an XmlDocument
    > parameter instead of the objects that represent it. However, I really
    > wouldn't advise you to do this as it's as non web service'y' as using a
    > dataset:
    > http://www.thejoyofcode.com/SOA_and...ervice_interfaces_are_the_spawn_of_Satan.aspx
    >
    > I guess you're probably looking to do this because you're worried about
    > performance but I really wouldn't unless you're actually having
    > performance problems. Otherwise it's premature optimisation:
    > http://www.thejoyofcode.com/Premature_Optimisation.aspx
    >
    > If possible - I'd try and change the 'other' component to take an
    > object and not an XmlDocument and do away with serialization until you
    > hit the wire. Though, I realise this might not be possible if the
    > component is legacy and/or not yours. Good luck!
    >
    > Josh
    > http://www.thejoyofcode.com/
    >
    > sean rogers wrote:
    > > hi
    > >
    > > 1. i have a biztalk orchestration that calls my web service.
    > > 2. My web service receives the BTS message and deserializes it
    > > 3. My webservice then takes the deserialized object and re-serializes it
    > > into an XmlDocument before sending it to another component to be processed.
    > >
    > > My question is - is there anyway to remove step 2 - the unnecessary
    > > deserialization from the BTS message into my object.
    > >
    > > Can i hack the deserialization code out of the webservice?
    > >
    > > thanks

    >
    >
     
    sean rogers, Aug 17, 2006
    #3
  4. sean rogers

    Josh Twist Guest

    Hi Sean,

    You can intercept the stream using a SoapExtension (search on google
    for lots of info) but this is typically to modify the stream in some
    way. It usually ends up hitting the normal deserialization mechanisms
    once you've fiddled with it.

    Josh
    http://www.thejoyofcode.com/




    sean rogers wrote:
    > thanks for your reply and your pragmatism. Its not exactly the awnser i was
    > looking for.
    >
    > I have heard about intercepting the data stream before it reaches the
    > webservice - and so keeping it in its Xml format.
    > Just wondered if anyone had some code to do it.
    >
    >
    > "Josh Twist" wrote:
    >
    > > You could just change your web service to accept an XmlDocument
    > > parameter instead of the objects that represent it. However, I really
    > > wouldn't advise you to do this as it's as non web service'y' as using a
    > > dataset:
    > > http://www.thejoyofcode.com/SOA_and...ervice_interfaces_are_the_spawn_of_Satan.aspx
    > >
    > > I guess you're probably looking to do this because you're worried about
    > > performance but I really wouldn't unless you're actually having
    > > performance problems. Otherwise it's premature optimisation:
    > > http://www.thejoyofcode.com/Premature_Optimisation.aspx
    > >
    > > If possible - I'd try and change the 'other' component to take an
    > > object and not an XmlDocument and do away with serialization until you
    > > hit the wire. Though, I realise this might not be possible if the
    > > component is legacy and/or not yours. Good luck!
    > >
    > > Josh
    > > http://www.thejoyofcode.com/
    > >
    > > sean rogers wrote:
    > > > hi
    > > >
    > > > 1. i have a biztalk orchestration that calls my web service.
    > > > 2. My web service receives the BTS message and deserializes it
    > > > 3. My webservice then takes the deserialized object and re-serializes it
    > > > into an XmlDocument before sending it to another component to be processed.
    > > >
    > > > My question is - is there anyway to remove step 2 - the unnecessary
    > > > deserialization from the BTS message into my object.
    > > >
    > > > Can i hack the deserialization code out of the webservice?
    > > >
    > > > thanks

    > >
    > >
     
    Josh Twist, Aug 17, 2006
    #4
    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. Replies:
    3
    Views:
    657
    Sahil Malik
    May 14, 2004
  2. =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=

    Deserialization Error--End Of Stream

    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=, Jul 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    439
    Steven Cheng[MSFT]
    Jul 30, 2004
  3. =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=

    Deserialization Error--End of Stream

    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=, Jul 29, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,441
    Marcin
    Aug 10, 2004
  4. =?Utf-8?B?TWlrZSBMb2dhbg==?=

    NameValueCollection Serialization Deserialization

    =?Utf-8?B?TWlrZSBMb2dhbg==?=, Dec 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,045
    Karl Seguin
    Dec 23, 2004
  5. =?Utf-8?B?QW5kcmUgRmxlZGdl?=

    design time control deserialization problem

    =?Utf-8?B?QW5kcmUgRmxlZGdl?=, Jul 28, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    360
    =?Utf-8?B?QW5kcmUgRmxlZGdl?=
    Jul 28, 2005
Loading...

Share This Page