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