Please forgive any mistakes in this question. I am not overly familiar with secure web services or WCF.
I need to consume a web service that uses WSE 2.0 and .Net 1.1.
The service is secured in two ways. An X509Certificate and a BinarySecurityToken added to the header.
I have code samples as to how to consume this Web Service when using Visual Studio 2003 and WSE 2.0.
My main question is should I be attempting to consume this Web Service using a "Web Reference" or a "Service Reference"?
The code samples I have use the binary Microsoft.Web.Services2. I am looking for the equivalent classes / methods that will allow me to perform the same functionality.
The two key lines of code I'm looking to replace are:
webService.ClientCertificates.Add(X509Certificate.CreateFromFile(fileName));
and
SoapContext context = webService.RequestSoapContext;
context.Security.Tokens.Add(binarySecurityToken);
Can anyone provide me some information as to which classes I should be looking at or any helpful articles that will help me understand this further?
EDIT: To add to this, the method I am struggling to find an alternative to is:
webService.RequestSoapContext;
I have found various alternative classes / methods in creating the security tokens however, without the RequestSoapContext I do not know where to add them.