473,493 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SoapExtension logging to SQL

Does anyone have an example of a SoapExtension that writes the incoming SOAP request to a table via SQL? I have tried editing the TraceExtension sample code on MSDN with little success.

I am not entirely sure what the newStream/oldStream members would be used for in a SQL logging scenario. I just want to inspect the incoming message, not modify it. From the API docs, it doesn't look like I'd need to override ChainStream() at all.

Any ideas?

--
MARK RICHMAN
Nov 21 '05 #1
2 2059
(removing a few groups)
I haven't done this but it shouldn't be difficult. what do you mean "with
little success"? what problems did you encounter?
-Dino
"Mark A. Richman" <no****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Does anyone have an example of a SoapExtension that writes the incoming SOAP
request to a table via SQL? I have tried editing the TraceExtension sample
code on MSDN with little success.

I am not entirely sure what the newStream/oldStream members would be used
for in a SQL logging scenario. I just want to inspect the incoming message,
not modify it. From the API docs, it doesn't look like I'd need to override
ChainStream() at all.

Any ideas?

--
MARK RICHMAN
Nov 21 '05 #2
I forgot to set the message.Stream.Position = 0 before I exited my SoapExtension! I do not need to use ChainStream either:

public override void ProcessMessage(SoapMessage message)
{
switch(message.Stage)
{
case SoapMessageStage.BeforeSerialize:
break;
case SoapMessageStage.AfterSerialize:
break;
case SoapMessageStage.BeforeDeserialize:
WriteInput(message);
break;
case SoapMessageStage.AfterDeserialize:
break;
default:
throw new Exception("invalid stage");
}
}

/// <summary>
/// Writes the incoming SOAP message to SQL
/// </summary>
/// <param name="message"></param>
private void WriteInput(SoapMessage message)
{
System.IO.StreamReader sr = new System.IO.StreamReader(message.Stream);
parameters = sr.ReadToEnd();

object[] parms = { parameters };

SqlHelper.ExecuteNonQuery(con, "InsertSoapMessage", parms);

message.Stream.Position = 0;
}
}

--
MARK RICHMAN
"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message news:Oy**************@TK2MSFTNGP15.phx.gbl...
(removing a few groups)
I haven't done this but it shouldn't be difficult. what do you mean "with
little success"? what problems did you encounter?
-Dino
"Mark A. Richman" <no****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Does anyone have an example of a SoapExtension that writes the incoming SOAP
request to a table via SQL? I have tried editing the TraceExtension sample
code on MSDN with little success.

I am not entirely sure what the newStream/oldStream members would be used
for in a SQL logging scenario. I just want to inspect the incoming message,
not modify it. From the API docs, it doesn't look like I'd need to override
ChainStream() at all.

Any ideas?

--
MARK RICHMAN
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3592
by: Trevor Pinkney | last post by:
Hi, Is it possible to reference a custom SoapExtension instance from within a WebMethod? I have a SoapExtension used by several web-services for generic logging. The SoapExtension logs the...
2
5567
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
0
1266
by: Symon | last post by:
I've got a web service project that was built under VS 2003 which has a SoapExtension in the project. The SoapExtension is registered in the <soapExtensionTypes> element of the web.config and has...
0
1727
by: thatsMaBoy | last post by:
Hi, I have a VB.NET 2003 web service client (EXE) that makes use of a SOAPExtension class. The client calls a web service that returns a SOAP message containing MIME encoded files. The...
0
7119
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
6989
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
7157
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,...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
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...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.