.NETGURU
How to do tasks before and after serialization
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.sdk.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Shrine (VIP)
I am using serialization in my webservice. I want to do some tasks before and after serialization.
How to do that. Can anyone explain me
--
Bye,
Shrine
Reply to this message...
 
    
John Paul. A (VIP)
Dear Shrine,
You can use SOAP Extensions. A beautiful concept in .NET.

SOAP extensions enable you to access and modify the SOAP messages that are exchanged between the client and the XML Web service. For example, you can use SOAP extensions to validate the SOAP message before it reaches the XML Web service and change the SOAP message after validation so that the XML Web service receives a valid SOAP request. You can also implement an encryption or compression algorithm that can be executed within an existing XML Web service by using SOAP extensions.

It is having 4 methods...

AfterDeserialize
This member represents the stage just after a SoapMessage is deserialized from a SOAP message into an object.

AfterSerialize
This member represents the stage just after a SoapMessage is serialized but before the SOAP message is sent over the wire.

BeforeDeserialize
This member represents the stage just before a SoapMessage is deserialized from the SOAP message that is sent over the network.

BeforeSerialize
This member represents the stage just before a SoapMessage is serialized.

You just dig this, you will get more and you can achieve your task shortly.

--
Thanks & Regards,
John Paul. A
MCP

"Shrine" wrote:

[Original message clipped]

Reply to this message...
 
    
Shrine (VIP)
Thankz,
Can you please explain me a sample code John Paul.
Please .....
--
Bye,
Shrine

"John Paul. A" wrote:

[Original message clipped]

Reply to this message...
 
    
John Paul. A (VIP)
This code needs no explanation. Because all the lines are self explanatory. Hands of thanks to Microsoft.

Public Overrides Sub ProcessMessage(message As SoapMessage)
Select Case message.Stage
Case SoapMessageStage.BeforeSerialize
' Do Some Task
Case SoapMessageStage.AfterSerialize
' Do Some Task
Case SoapMessageStage.BeforeDeserialize
' Do Some Task
Case SoapMessageStage.AfterDeserialize
' Do Some Task
Case Else
Throw New Exception("invalid stage")
End Select
End Sub

--
Thanks & Regards,
John Paul. A
MCP

"Shrine" wrote:

[Original message clipped]

Reply to this message...
 
    
Shrine (VIP)
Thanks,
--
Bye,
Shrine

"John Paul. A" wrote:

[Original message clipped]

Reply to this message...
 
 
System.Runtime.Serialization.Formatters.SoapMessage
System.Web.Services.Protocols.SoapMessage
System.Web.Services.Protocols.SoapMessageStage




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification