Using SoapExtensions to intercept and decrypt MIME formatted SOAP messages

  • Thread starter Thread starter Imran
  • Start date Start date
I

Imran

Hi,

Please bear with me as I have only 1 weeks .NET experience.

I am using VB.NET to write a stand-alone client application that
connects to a Web service. I successfully send a request for a list
of items (i.e. getItemList), and successfully receive the list. I
then send a request for individual items from the list (i.e. getItem),
and successfully receive the item.

The situation is that the individual item/SOAP response contains
multipart MIME sections.

I would like to intercept (using SoapExtensions) the SOAP message
before it is deserialized and be able to decode the MIME sections,
before sending the SOAP message onto the deserializer.

I know I must intercept and decode the MIME as the deserializer
complains about the formatting of the SOAP message when it attempts to
read the message. (My requests are not encoded, only the responses
for the individual items are.)

I know that I must intercept the message when the message state is
BeforeDeserialize and perform the relevant actions.

I would be grateful if anyone can point me in the right direction for
HOW to decode the MIME and send the decoded message forward onto the
deserializer. Any examples would be greatly appreciated.

Thanks in advance.

AIM
 
Hi!

Maybe I can point you somethings. Here we needed to add
some extra compression to the SOAP body, so we intercept
the messages, then add ZIP compression, and finally we let
the message go.

So, we created the CompressionExtension. This is a class
that inherits from:
System.Web.Services.Protocols.SoapExtension. Then, we
created the [CompressionExtension] attribute, that
inherits from: SoapExtensionAttribute. That attribute must
be added to each method that we want to use in the
compressed fashion... At the client, we compress the
outbound messages, and decode the inbound messages... in
the service, we do the opposite.

Hope it helps...

Cheers...
Mariano
 
Back
Top