Forum Discussion

Jcorwin's avatar
Jcorwin
Occasional Contributor
9 years ago

Passing Certificate Credentials to WS Call

I have been using testcomplete for some time but am new to the Web Services functionality.  I have a project set up and am able to access all of the properties and methods associated with the WS under test.  The issue I am having is the proper way to pass certificate credentials in the WS request.  I have tried both SetCertificate and SetCertificateEX using what I believe to be the proper input para ( str, int , int /int, int, int, str respectively) but I still get the error around proper authentication.

 

VBScript runtime error.

 

A certificate is required to complete client authentication - URL:MYWEBSERVICE - SOAPAction:urn:SubmitRequest

 

I am assuming that if the SertCert functions were passing bad data, I would know that via an error message, the one above seems to indicate that the auth attempt isn’t present at all?  The sample call in script is as follows:

 

Call webservices.myservice.Credentials.ClientCertificate.SetCertificateex(1,5,14," key identifier ")

I am thinking that since every request to this WS needs to be associated with a certificate that the “onWebServiceRequest” event needs to be in play but that is just a guess.  Any thoughts?  If yes to onWebServiceRequest event I’m really having an issue figuring out how to use it.

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    I did not try with the client certificates, but for me the

    A certificate is required to complete client authentication [...]

    error sounds like that the certificate was not found (and thus no attempt to authenticate was taken).

     

    Are you sure that correct parameters were specified fir the SetCertificateEx() function? Is certificate installed on the system where test code is executed?

    • Jcorwin's avatar
      Jcorwin
      Occasional Contributor

      "Are you sure that correct parameters were specified fir the SetCertificateEx() function?"

       

      I believe they are correct but will check with the cert creator this morning.  I was confused on the error message and thought that  I would see something about "cert not found"...in essence I guess that's what I'm seeing. 

       

       

      "Is certificate installed on the system where test code is executed?"

       

      Yes - it is definately available in the personal cert store on the machine in question AND I can browse the WS using IE and that cert.

       

      I will check input parameters again today and let you know if I find anything.  Thank you for the reply!