betdaq icon indicating copy to clipboard operation
betdaq copied to clipboard

baseclient.py has stopped working.. KeyError: 'ns0'

Open JacobHJ opened this issue 3 years ago • 1 comments

Hi. I’m having issues running the following code, which has been working flawlessly until recently:

from betdaq.apiclient import APIClient api = APIClient('username', 'password') sport_ids = api.marketdata.get_sports()

error:

Traceback (most recent call last): File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\zeep\xsd\schema.py", line 172, in get_ns_prefix return self._prefix_map_custom[prefix] KeyError: 'ns0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\zeep\xsd\schema.py", line 174, in get_ns_prefix return self._prefix_map_auto[prefix] KeyError: 'ns0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\UK\Desktop\Betdaq test.py", line 2, in api = APIClient('username', password') File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\betdaq\apiclient.py", line 8, in init super(APIClient, self).init(username, password) File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\betdaq\baseclient.py", line 13, in init self.initialise_type_factories() File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\betdaq\baseclient.py", line 33, in initialise_type_factories self.readonly_types = self.readonly_client.type_factory('ns0') File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\zeep\client.py", line 238, in type_factory return Factory(self.wsdl.types, 'type', namespace) File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\zeep\client.py", line 78, in init self._ns = types.get_ns_prefix(namespace) File "C:\Users\UK\AppData\Local\Programs\Python\Python37\lib\site-packages\zeep\xsd\schema.py", line 176, in get_ns_prefix raise ValueError("No such prefix %r" % prefix) ValueError: No such prefix 'ns0'

Thanks a lot for any kind of attention. Best regards Jacob

JacobHJ avatar Dec 13 '22 08:12 JacobHJ

changing the url of the WSDL file in baseclient.py to: 'https://api.betdaq.com/v2.0/API.wsdl' solved my issue.

JacobHJ avatar Dec 13 '22 13:12 JacobHJ