I'm trying to sign (and sign only) the body of every outgoing message that uses this custom endpoint behavior. When I first created this it was for signing a custom SOAP header. We are moving away from that and going to just sign the body.
We have some applications that have 10+ web service references. We don't want to touch the reference.cs for anything. Below is the code I had before for signing the custom soap header. I'm trying to modify it to just sign the body.
My modified code is below, and the error I get.
Private Class CustomHeaderBehavior
Public Sub New()
Private Sub AddBindingParameters( _
ByVal endpoint As ServiceModel.Description.ServiceEndpoint, _
ByVal bindingParameters As ServiceModel.Channels.BindingParameterCollection) _
Dim body As New Xml.XmlQualifiedName("Body", "http://schemas.xmlsoap.org/soap/envelope/")
Dim BodyMsgPartSpec As New ServiceModel.Security.MessagePartSpecification()
BodyMsgPartSpec.IsBodyIncluded = True
Dim requirements As ServiceModel.Security.ChannelProtectionRequirements = bindingParameters.Remove(Of ServiceModel.Security.ChannelProtectionRequirements)()
View Complete Post