469,909 Members | 1,693 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

Get Raw XML from SoapServer.SoapInvoke Request, Response, ""

While using the Soap generated ASP code, I would like to dump the raw
contents of the request and response objects using Response.AppendToLog.

I have tried using variations of the following code, but I may be barking up
the wrong tree with this approach. Any expert help would greatly be
appreciated.

Dim objReader
Set objReader = CreateObject("MSSOAP.SoapReader")
objReader.Load Request
add code to output to the log
objReader.Load Response
add code to output to the log
===SOAP GENERATED CODE===

<%@ LANGUAGE=VBScript %>
<%
Option Explicit
On Error Resume Next
Response.ContentType = "text/xml"
Dim SoapServer
If Not Application("CUCTransactionInitialized") Then
Application.Lock
If Not Application("CUCTransactionInitialized") Then
Dim WSDLFilePath
Dim WSMLFilePath
WSDLFilePath = Server.MapPath("CUCTransaction.wsdl")
WSMLFilePath = Server.MapPath("CUCTransaction.wsml")
Set SoapServer = Server.CreateObject("MSSOAP.SoapServer")
If Err Then SendFault "Cannot create SoapServer object. " &
Err.Description
SoapServer.Init WSDLFilePath, WSMLFilePath
If Err Then SendFault "SoapServer.Init failed. " & Err.Description
Set Application("CUCTransactionServer") = SoapServer
Application("CUCTransactionInitialized") = True
End If
Application.UnLock
End If
Set SoapServer = Application("CUCTransactionServer")
SoapServer.SoapInvoke Request, Response, ""
If Err Then SendFault "SoapServer.SoapInvoke failed. " & Err.Description

--
Robert Hill
Sep 19 '05 #1
2 3868
Hi Robert,

Welcome to MSDN newsgroup.
From your description, you're currently using the SoapServer component in
SoapToolKit to serve as XML webservice server in ASP application. And
you're wondering how to intercept the RAW soap XML message returned through
the SoapServer.Invoke method, yes?

As for the SoapServer.Invoke method, it accept an InputStream and an
OutputStream which implement IStream interface. The internally runtime will
retrieve SOAP request xml message from the input stream and then generate
output SOAP response message and write out into the OutputStream. If we
directl,y pass the ASP 's Request, response stream object into it, the
output respose SOAP message will be flushed directly into the
response/clientside, we haven't the chance to intercept the content. So if
you want to intercept the response content, we should not directly pass the
Response ASP object as the outpu Stream parameter. Instread , we need to
prepare another Stream object(implement IStream) and pass it in
SoapServer.Invoke and then we can retrieve the XML content in that Stream
object. After our cutomization, we write the content from our stream object
into the Response's Stream. For the custom stream object, you can have a
look at the ADODB.Stream component, also, we can also create our own COM
components which implement the IStream interface.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: Get Raw XML from SoapServer.SoapInvoke Request, Response, ""
| thread-index: AcW9Ir1iglNLgLxbSFOl10o+wJtwLg==
| X-WBNR-Posting-Host: 192.85.50.1
| From: "=?Utf-8?B?Um9iZXJ0SGlsbEVEUw==?=" <rw****@nospam.nospam>
| Subject: Get Raw XML from SoapServer.SoapInvoke Request, Response, ""
| Date: Mon, 19 Sep 2005 07:02:15 -0700
| Lines: 46
| Message-ID: <57**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.inetserver.asp.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.inetserver.asp.general:26407
| X-Tomcat-NG: microsoft.public.inetserver.asp.general
|
| While using the Soap generated ASP code, I would like to dump the raw
| contents of the request and response objects using Response.AppendToLog.
|
| I have tried using variations of the following code, but I may be barking
up
| the wrong tree with this approach. Any expert help would greatly be
| appreciated.
|
| Dim objReader
| Set objReader = CreateObject("MSSOAP.SoapReader")
| objReader.Load Request
| add code to output to the log
| objReader.Load Response
| add code to output to the log
|
|
| ===SOAP GENERATED CODE===
|
| <%@ LANGUAGE=VBScript %>
| <%
| Option Explicit
| On Error Resume Next
| Response.ContentType = "text/xml"
| Dim SoapServer
| If Not Application("CUCTransactionInitialized") Then
| Application.Lock
| If Not Application("CUCTransactionInitialized") Then
| Dim WSDLFilePath
| Dim WSMLFilePath
| WSDLFilePath = Server.MapPath("CUCTransaction.wsdl")
| WSMLFilePath = Server.MapPath("CUCTransaction.wsml")
| Set SoapServer = Server.CreateObject("MSSOAP.SoapServer")
| If Err Then SendFault "Cannot create SoapServer object. " &
| Err.Description
| SoapServer.Init WSDLFilePath, WSMLFilePath
| If Err Then SendFault "SoapServer.Init failed. " & Err.Description
| Set Application("CUCTransactionServer") = SoapServer
| Application("CUCTransactionInitialized") = True
| End If
| Application.UnLock
| End If
| Set SoapServer = Application("CUCTransactionServer")
| SoapServer.SoapInvoke Request, Response, ""
| If Err Then SendFault "SoapServer.SoapInvoke failed. " & Err.Description
|
| --
| Robert Hill
|

Sep 20 '05 #2
Hi Robert,

Have you got any further progress on this issue or does the suggestion in
my last reply helps a little? If there're any further things we can help,
please feel free to post here.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| X-Tomcat-ID: 58676845
| References: <57**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Tue, 20 Sep 2005 03:38:56 GMT
| Subject: RE: Get Raw XML from SoapServer.SoapInvoke Request, Response, ""
| X-Tomcat-NG: microsoft.public.inetserver.asp.general
| Message-ID: <ri*************@TK2MSFTNGXA01.phx.gbl>
| Newsgroups: microsoft.public.inetserver.asp.general
| Lines: 107
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.inetserver.asp.general:26430
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Robert,
|
| Welcome to MSDN newsgroup.
| From your description, you're currently using the SoapServer component
in
| SoapToolKit to serve as XML webservice server in ASP application. And
| you're wondering how to intercept the RAW soap XML message returned
through
| the SoapServer.Invoke method, yes?
|
| As for the SoapServer.Invoke method, it accept an InputStream and an
| OutputStream which implement IStream interface. The internally runtime
will
| retrieve SOAP request xml message from the input stream and then generate
| output SOAP response message and write out into the OutputStream. If we
| directl,y pass the ASP 's Request, response stream object into it, the
| output respose SOAP message will be flushed directly into the
| response/clientside, we haven't the chance to intercept the content. So
if
| you want to intercept the response content, we should not directly pass
the
| Response ASP object as the outpu Stream parameter. Instread , we need to
| prepare another Stream object(implement IStream) and pass it in
| SoapServer.Invoke and then we can retrieve the XML content in that Stream
| object. After our cutomization, we write the content from our stream
object
| into the Response's Stream. For the custom stream object, you can have a
| look at the ADODB.Stream component, also, we can also create our own COM
| components which implement the IStream interface.
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
|
| --------------------
| | Thread-Topic: Get Raw XML from SoapServer.SoapInvoke Request, Response,
""
| | thread-index: AcW9Ir1iglNLgLxbSFOl10o+wJtwLg==
| | X-WBNR-Posting-Host: 192.85.50.1
| | From: "=?Utf-8?B?Um9iZXJ0SGlsbEVEUw==?=" <rw****@nospam.nospam>
| | Subject: Get Raw XML from SoapServer.SoapInvoke Request, Response, ""
| | Date: Mon, 19 Sep 2005 07:02:15 -0700
| | Lines: 46
| | Message-ID: <57**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.inetserver.asp.general
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.inetserver.asp.general:26407
| | X-Tomcat-NG: microsoft.public.inetserver.asp.general
| |
| | While using the Soap generated ASP code, I would like to dump the raw
| | contents of the request and response objects using Response.AppendToLog.
| |
| | I have tried using variations of the following code, but I may be
barking
| up
| | the wrong tree with this approach. Any expert help would greatly be
| | appreciated.
| |
| | Dim objReader
| | Set objReader = CreateObject("MSSOAP.SoapReader")
| | objReader.Load Request
| | add code to output to the log
| | objReader.Load Response
| | add code to output to the log
| |
| |
| | ===SOAP GENERATED CODE===
| |
| | <%@ LANGUAGE=VBScript %>
| | <%
| | Option Explicit
| | On Error Resume Next
| | Response.ContentType = "text/xml"
| | Dim SoapServer
| | If Not Application("CUCTransactionInitialized") Then
| | Application.Lock
| | If Not Application("CUCTransactionInitialized") Then
| | Dim WSDLFilePath
| | Dim WSMLFilePath
| | WSDLFilePath = Server.MapPath("CUCTransaction.wsdl")
| | WSMLFilePath = Server.MapPath("CUCTransaction.wsml")
| | Set SoapServer = Server.CreateObject("MSSOAP.SoapServer")
| | If Err Then SendFault "Cannot create SoapServer object. " &
| | Err.Description
| | SoapServer.Init WSDLFilePath, WSMLFilePath
| | If Err Then SendFault "SoapServer.Init failed. " & Err.Description
| | Set Application("CUCTransactionServer") = SoapServer
| | Application("CUCTransactionInitialized") = True
| | End If
| | Application.UnLock
| | End If
| | Set SoapServer = Application("CUCTransactionServer")
| | SoapServer.SoapInvoke Request, Response, ""
| | If Err Then SendFault "SoapServer.SoapInvoke failed. " & Err.Description
| |
| | --
| | Robert Hill
| |
|
|

Sep 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Sam Sungshik Kong | last post: by
reply views Thread by Hardy Wang | last post: by
3 posts views Thread by Mange | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.