+ Start a Discussion

How to transfer Credentials to external third party web service?



How can transfer Credentials to external third party web service


I loaded external web service wsdl to apex class by generate to apex.


And have a button that calls to new class method.


External WS expects to get Credentials username and password and It fails because it’s not trnasferred.



 It works fine .Net C# as below:



WSClass variable= new WSClass ();


NetworkCredential credentials = new NetworkCredential("username", "password");


variable.Credentials = credentials;




How can I transfer in APEX?


Is “Certificate and Key Management” can be a solution?

And which one (Create Self-Signed Certificate or Create CA-Signed Certificate)


Or any other solution



Thank you



Sonali BhardwajSonali Bhardwaj

I think you don't need to give Network credentials in Salesforce/Apex because SFDC sends request from its server not from your network.


Thank you for quick response.


Credentials (username and password) MUST be transferred, becouse of web service uses it to connect to onother system


so i need a way to attach it to request.



Thank you