avoiding deserialization

S

sean rogers

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
 
J

Josh Twist

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/
 
S

sean rogers

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.
 
J

Josh Twist

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/
 

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,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top