473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 4055
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
1
by: Matt | last post by:
If we use GET protocol, we can use either Request("controlname") or Request.QueryString("controlname") to get the data entered by the user. But if we use POST protocol, we MUST use...
4
by: Ben Amada | last post by:
Hello! There are a couple of visitors (out of dozens) to this web page who are causing the following error to occur: "Object reference not set to an instance of an object." I'm actually...
0
by: Hardy Wang | last post by:
Hi, I have an application which encrypts some certian link to format like:...
3
by: Mange | last post by:
I'm using WebRequest class to access a PHP script, but keep getting a 400 error from the server when calling the GetResponse() method. I have added the url to the script in the bypass list in...
0
by: . | last post by:
http://daviderognoni.blogspot.com?locawapp - MAIN NEWS =========== * add thread * add "Request" object * new "locawapp_main" function * fixed files.py
7
by: vvkl | last post by:
I have readed a example code from MSDN about FormsAuthenticationTicket calss, but there's a line I can't understand : 'strRedirect = Request;' What's the mean in which square brackets? Thank...
7
by: sami | last post by:
Hi I am trying to write a facebook application in python - I have been programming simple desktop applications till now and am not really familiar with web apps Pyfacebook is the wrapper for...
2
jbellis
by: jbellis | last post by:
Can someone direct me to a good explanation or complete code example of sending a response from a perl script? I suspect that I don't even understand what's going on because web searches don't show...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.