I'd like to sign a Soap request (.NET 3.5, C#) with a certificate stored in the computer (reading of certificate is ok).
I don't want the request to be encrypted (that's what I get when I change Security.Mode
and Security.Message
properties on WSHttpBinding
). I am looking for a signed Soap header .
After reading tons of articles on MSDN, blog, StackOverflow... I came up with this approach: using IClientMessageInspector
and method BeforeSendRequest
. I can set a breakpoint in it and see my request, but how to modify its XML content ?
Modifying the message is possible - for sample code and explanations see
Basically you copy the Message
to an XML Doc as a buffered copy, modify the XML, then create a new Message
from that modified XML and assign the new Message
to the ref Message
param...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.