Repository: ansible/awx

Issue:
Unable to use CCP lookup plugin with empty webservice_id
### Please confirm the following

- [X] I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.

### Bug Summary

When job uses the  `CyberArk Central Credential Provider Lookup` credential plugin with an empty web service id, it fails with the exception: 

```
Traceback (most recent call last):
  File "/awx_devel/awx/main/tasks/jobs.py", line 508, in run
    args = self.build_args(self.instance, private_data_dir, passwords)
  File "/awx_devel/awx/main/tasks/jobs.py", line 941, in build_args
    ssh_username = creds.get_input('username', default='')
  File "/awx_devel/awx/main/models/credential/__init__.py", line 275, in get_input
    return self._get_dynamic_input(field_name)
  File "/awx_devel/awx/main/models/credential/__init__.py", line 309, in _get_dynamic_input
    return input_source.get_input_value()
  File "/awx_devel/awx/main/models/credential/__init__.py", line 1250, in get_input_value
    return backend(**backend_kwargs)
  File "/awx_devel/awx/main/credential_plugins/aim.py", line 73, in aim_backend
    webservice_id = kwargs['webservice_id']
KeyError: 'webservice_id'
```

The issue is only reproducible if we create a CCP lookup credential using API and we do not provide the `webservice_id` key as the input.  If you create CCP lookup with UI - everything works fine. 

### AWX version

devel

### Select the relevant components

- [ ] UI
- [X] API
- [ ] Docs
- [ ] Collection
- [ ] CLI
- [ ] Other

### Installation method

docker development environment

### Modifications

no

### Ansible version

_No response_

### Operating system

_No response_

### Web browser

_No response_

### Steps to reproduce

1. Create CyberArk Central Credential Provider Lookup credential. Do not provide the WebService ID value, keep it empty. I used API to create credetnail and the webservice_id was missing in the inputs: 

```
inputs = {
            'url': url,
            'app_id': app_id,
            'client_key': client_key,
            'client_cert': client_cert,
            'verify': verify
}

payload = factories.credential.payload(
    name=fauxfactory.gen_utf8(),
    description=fauxfactory.gen_utf8(),
    credential_type=cred_type,
    inputs=inputs
)
```

2. Create Machine credential that uses the CCP lookup credential. Set proper Object query. 
3. Create Job Template that uses this credential. Run the job. 



### Expected results

The lookup should use default webservice id: `AIMWebService`

### Actual results

Exception occured. See description. 



### Additional information

_No response_


Discussion:
@infamousjoeg can you please take a look when you have some time? 
@obaranov I am unable to recreate this issue on the `devel` branch.
> @obaranov I am unable to recreate this issue on the `devel` branch.

This only happens when I use API call directly without providing the webservice_id at all. UI works well, since it puts the webservice_id='' to the call. 

Resolving patch:
diff --git a/awx/main/credential_plugins/aim.py b/awx/main/credential_plugins/aim.py
--- a/awx/main/credential_plugins/aim.py
+++ b/awx/main/credential_plugins/aim.py
@@ -70,7 +70,7 @@ def aim_backend(**kwargs):
     client_cert = kwargs.get('client_cert', None)
     client_key = kwargs.get('client_key', None)
     verify = kwargs['verify']
-    webservice_id = kwargs['webservice_id']
+    webservice_id = kwargs.get('webservice_id', '')
     app_id = kwargs['app_id']
     object_query = kwargs['object_query']
     object_query_format = kwargs['object_query_format']


Test patch: