-
-
Save arun12209/cf6ba368dc918cd721c70e3982f9549c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Call external services registered actions from apex | |
//Instantiate the external service Apex class | |
ExternalService.BankService service = new ExternalService.BankService(); | |
//set request | |
ExternalService.BankService.getAccount_Request req = new ExternalService.BankService.getAccount_Request(); | |
req.accountName = 'DynamicsCorporation'; | |
try{ | |
//make callout | |
ExternalService.BankService.getAccount_Response res = service.getAccount(req); | |
system.debug('200 response id => '+ res.Code200.Id); | |
system.debug('200 repsonse: available balance => '+res.code200.availableBal); | |
}catch(ExternalService.BankService.getAccount_ResponseException exc){ | |
system.debug('404 response: error message => '+ exc.code404.errorMessage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment