hello,
i am working on my first web service project. i am writing a webpage
that consumes a ws from one of our partners, so i do not have access to
the ws code itself. this partner uses certificates for security. the
steps they gave me to access it are:
1) run wsdl.exe on the "webservice.wsdl" given to me
2) compile the resulting .CS proxy class into a .DLL assembly
3) add this to my project's References section
4) install the .PFX certificate given to me by double-clicking it,
input password
5) go into IE (or Control Panels -> Internet Options) and go to Content
tab, Certificates...
6) click on the newly installed cert and Export, doing so as a DER
X.509 ".CER" file
7) do the following in my app code:
//load up the .cer
X509Certificate cert =
X509Certificate.CreateFromCertFile(@"c:\temp\test. cer");
//attach the cert to my proxy class ws object
ws.ClientCertificates.Add(cert);
//app authentication for proxy object
ws.Credentials = new NetworkCredential("[name]", "[password]");
//use webservice
bool result = ws.ValidateCustomer(customerID);
....however, when i run any of the ws methods, i get a 403 error:
The request failed with HTTP status 403: Access Forbidden.
....according to my IT contact at the partner, he said their logs report
i am failing at the web server level, and am not even reaching the
application's authentication (the NetworkCredential entry). he
indicated this is due to a problem w/ my certificate.
he also said other clients are using it, and provided me w/ a secure
test-form URL that uses the service. i am able to access the URL on
their secure site, so i know it works and apparently my certificate
works (IE asks me if i want to use the installed cert, i say Yes, i get
in and can run the form).
now i am stuck. i have granted ASPNET access to the .cer file, nothing.
have also farted around with the WinHttpCertCfg command line util,
running:
winhttpcertcfg -i webservice.pfx -p [password] -c LOCAL_MACHINE\my -a
aspnet
....which i see puts in entries to "C:\Documents and Settings\All
Users\Application Data\Microsoft\Crypto\RSA\MachineKeys". no use.
obviously, im not a certificate expert. any help would be
appreciated...
thanks!
matt