Cyberiafreak

"Fortunate are those who take the first steps.” ― Paulo Coelho

What is SOAPExtension? When to extend and Why?

SoapExtension allows you to alter the SOAP messages sent to and from a Web service or a Web service client. For instance, if you want to implement an encryption or compression algorithm to run with an existing Web service.. then you need to extend.

To implement-derive a class from the SoapExtension class.
1) ChainStream, a virtual method 2) GetInitializer, an abstract method with two signatures
3) Initialize, an abstract method 4) ProcessMessage, an abstract method

Read about WebService Life Cycle from MSDN.

When and why?
1) You may run into situation where you need to compress and decompress on your way – then you need this extension.
2) You may need to get the content length / packet size for your webrequest and webresponse, then you need this extension. Coz, when you compress your request and get you response in compressed format.. you wont be getting the content length for your response. You have to serialize to stream and then get the length out of the stream.
Do you think any other situation?

Advertisements

April 26, 2012 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: