function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suloxsulox 

Error: Compile Error: Method does not exist or incorrect signature

I have an external web service that I am trying to invoke in an apex class,  but when I try to compile the class I get the following error message:

 

Error: Compile Error: Method does not exist or incorrect signature: [Cryptographyapi].Decrypt(Cryptographyapi.CredentialInfo, Cryptographyapi.DecryptRq) at line 64 column 52 

 

       Cryptographyapi.CredentialInfo Credentials2 = new Cryptographyapi.CredentialInfo();
       Credentials2.UserName = config.API_Userid__c;
       Credentials2.Password = config.APIPassword__c;
       Credentials2.SecurityToken = config.APISecurityToken__c;

 

 

           Cryptographyapi crypto = new Cryptographyapi();  //Web service class generated from wsdl
           Cryptographyapi.DecryptRq crrequest = new Cryptographyapi.DecryptRq();
           crrequest.TextToDecrypt = creditcard.Credit_Card_Number__c;
           crrequest.PassPhrase = passPhrase;
           crrequest.Salt = saltValue;
           crrequest.HashAlgorithm = hashAlgorithm;
           crrequest.PasswordIterations = passwordIterations;
           crrequest.InitVector = initVector;
           crrequest.KeySize = keySize;
    

            //This is the signature for the method below that throws the error       
           //public Cryptographyapi.DecryptRs Decrypt(Cryptographyapi.CredentialInfo, Cryptographyapi.DecryptRq)  -

 

               //This is the method that causes the error 

               Cryptographyapi.DecryptRs crresponse =  crypto.Decrypt(Credentials2,crrequest);

 

Everything looks correct. I cannot see a problem with the way I am calling the web service. In addition I have a different web service I am calling on the same page and that works fine. Any help would be greatly appreciated.
   

Anup JadhavAnup Jadhav

Hi sulox,

 

looks correct to me....unless there is a typo.

 

Can you try commenting the method in error, and see if the code executes the other webservice on the page?

 

- A J

suloxsulox
I've done that already and the other web service executes fine. This is a very simple web service. All is does is encrypt or decrypt data. The other is much more complex and works fine. Very strange. In addition the very weird thing is that all of the data structures compile fine. It is just when I try to use either the decrypt or encrypt method do I have issues. I also tried to run it as if it was a static method too just to see if that made a difference, but it did not. I have also recompiled the code on my server and regenerated the wsdl class several times and still no go.
Anup JadhavAnup Jadhav

hmm..

 

could you post the Apex class(generated using the WSDL) snapshot for this method?

 

- A J