A Windows Forms application calls in to a Web service named SensitiveData.
The project has a Web reference named SensitiveDataWS.
The code uses a class of type SensitiveDataWS.Service. SensitiveDataWS.Service is a proxy to the Web service.
An administrator reports that users running the client application receive a SoapHeaderException exception with the following message text:
“Security requirements are not satisfied because the security header is not present in the incoming message”.
You discover that the Web Services Enhancements (WSE) 3.0 policy file for the Web service was changed to require the encryption of SOAP messages.
You acquire the X.509 certificate that is used for encryption in the Web service.
You need to ensure that the Windows Forms application meets the new security requirements of the Web service.
What should you do?
A.
In each Web method, assign an instance of the X509Certificate class that is initialized with the acquired X.509 certificate, to the ClientCertificates property of the SensitiveDataWS.Service class.
B.
Apply WSE security to the Windows Forms project that is configured to use the acquired X.509 certificate with the Sign and Encrypt protection level.
Renew the Web reference and modify the code to use the new SensitiveDataWS.ServiceWse class.
C.
Apply WSE security to the Windows Forms project that is configured to use the acquired X.509 certificate with the Sign-Only protection level.
Renew the Web reference and modify the code to use the new SensitiveDataWS.ServiceWse class.
D.
In the Windows Forms project, create a custom class that inherits from the SoapHeader attribute class with a public property of type X509Certificate.
Initialize the public property with the acquired X.509 certificate.
Apply the created attribute to code in the client application that calls the Web service.
Initialize the attribute with the name of the custom class.