Last post May 30, 2014 03:05 AM by Michelle Ge - MSFT
May 29, 2014 12:34 PM|BtBJim|LINK
I have defined a web client for an external web SOAP service secured by a certificate and user name and password.
I want to use the following code to instantiate the web client and set the credential for the client.
ws1 = New CDPHService.CDPH_transferPortTypeClient(contractName, EndPoint)
Catch ex As Exception
MsgBox("set certificate error " + Err.Number.ToString + Chr(10) + ex.Message)
This system is running Windows 8.1 Pro, I am developing in Visual Basic with Visual Studio 2012. The application references .Net Framework 4
Windows 8.1 certificate manager shows the certificate with the friendly name "cdph"
The MSDN reference for X509FindType.FindByApplicationPolicy states specifically that FindByApplicationPolicy wants a string with the application policy friendly name. ( http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509findtype(v=vs.110).aspx)
When the SetCertificate statement is executed, it returns error 5 The OID value was invalid.
Why would that error be generated? Or more generally - why isn't the certificate being found?
May 30, 2014 03:05 AM|Michelle Ge - MSFT|LINK
According to your code and the error, I think you should make sure the installing of certificate is correct.
There is an artical about simple steps to enable X.509 certificates on WCF, please refer to the links below:
#Securing WCF Services with Certificates:http://www.codeproject.com/KB/WCF/wcf_certificates.aspx
If it can't solve your problem, I suggest you going to WCF forum as link below, there will provide more professional support:
Hope it's useful for you.