Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting response from SOAP
Message
From
01/03/2010 21:58:41
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web Services
Title:
Getting response from SOAP
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01451885
Message ID:
01451885
Views:
98
This is a subset of my Web Service class which intercepts the SOAP message and stores it into the HTTPContext so I can access it from my application.
        Public Overrides Sub ProcessMessage(ByVal message As SoapMessage)
            Dim loStreamReader As StreamReader = Nothing
            Dim lcString As String = ""

            Select Case message.Stage

                Case SoapMessageStage.BeforeSerialize

                Case SoapMessageStage.AfterSerialize
                    WriteOutput(message)

                Case SoapMessageStage.BeforeDeserialize
                    WriteInput(message)

                    ' Retrieve the SOAP Message from the Input Stream
                    ' Save the SOAP Message in Request-scope State Bag

                    System.Web.HttpContext.Current.Request.InputStream.Position = 0

                    loStreamReader = New StreamReader(System.Web.HttpContext.Current.Request.InputStream)
                    lcString = loStreamReader.ReadToEnd()

                    System.Web.HttpContext.Current.Items("HTTPInputStream") = lcString

                Case SoapMessageStage.AfterDeserialize

            End Select

        End Sub
So, basically, later on in the application, I can know what was received in the SOAP envelope. Now, we need to do the same thing for the response. This is the difficult part. Has anyone done that before? Basically, I need to know what was sent to the client.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform