>One particular one Web Service I need to send data to requires us to send a header. This is a X509 certificate. For some kind of reason, we cannot send it using something like this:
>
>
> ' Adjust the URL
> loTheWebService.Url = Trim(lcURL)
>
> ' Create the certificate
> loX509Certificate = New X509Certificate(Convert.FromBase64String("TheCertificateHere"))
>
> ' Add the certificate
> loTheWebService.ClientCertificates.Add(loX509Certificate)
>
> ' Call the method
> lcXML = loTheWebService.TheMethod(lcXml)
>
>
>The reason is that they do not want to rely on the server to validate the certificate. They want to validate it at the code level. So, they are asking us to send it as part of the headers. When using high level, it is possible to add a header? If not, that would mean I would have to switch to a low level SOAP approach.
I *think* it is just a case of deriving from the SoapHeader class, adding a property for the certificate and then adding the header to the SoapMessage.Headers collection. But if the web service requires this then they should specify the exact required format for the header.....