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
Messageto an XML Doc as a buffered copy, modify the XML, then create a newMessagefrom that modified XML and assign the newMessageto theref Messageparam…