Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created June 9, 2022 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/16bbb9d552444d547bd372f6f97e0d25 to your computer and use it in GitHub Desktop.
Save arun12209/16bbb9d552444d547bd372f6f97e0d25 to your computer and use it in GitHub Desktop.
ExternalService.BankService service = new ExternalService.BankService();
//set request
ExternalService.BankService.addAccount_Request req = new ExternalService.BankService.addAccount_Request();
req.accountName = 'GreenMotorCorporation';
req.accountType = 'Customer';
try{
//make callout
ExternalService.BankService.addAccount_Response res = service.addAccount(req);
system.debug('200 response id => '+ res.Code201.id);
system.debug('200 repsonse: name => '+res.Code201.name);
system.debug('200 repsonse: available balance => '+res.Code201.availableBal);
system.debug('200 repsonse: type => '+res.Code201.z0type);
}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