BingAds / BingAds-Python-SDK

Other
116 stars 162 forks source link

suds.TypeNotFound: Type not found: 'CalloutAdExtension' #17

Closed iamdoron closed 7 years ago

iamdoron commented 8 years ago

I tried to upgrade from 10.4.1 to 10.4.4 and I got to following error (happens also in 10.4.2)

from bingads.v10.bulk import *
  File "/usr/local/lib/python2.7/site-packages/bingads/v10/bulk/__init__.py", line 11, in <module>
    from .file_reader import *
  File "/usr/local/lib/python2.7/site-packages/bingads/v10/bulk/file_reader.py", line 2, in <module>
    from .entities.bulk_entity import BulkEntity
  File "/usr/local/lib/python2.7/site-packages/bingads/v10/bulk/entities/__init__.py", line 17, in <module>
    from .ad_extensions import *
  File "/usr/local/lib/python2.7/site-packages/bingads/v10/bulk/entities/ad_extensions/__init__.py", line 8, in <module>
    from .bulk_callout_ad_extensions import *
  File "/usr/local/lib/python2.7/site-packages/bingads/v10/bulk/entities/ad_extensions/bulk_callout_ad_extensions.py", line 9, in <module>
    _CalloutAdExtension = type(_CAMPAIGN_OBJECT_FACTORY_V10.create('CalloutAdExtension'))
  File "/usr/local/lib/python2.7/site-packages/bingads/service_client.py", line 341, in _create_with_cache
    self.object_cache[name] = self.create_without_cache(name)
  File "/usr/local/lib/python2.7/site-packages/suds/client.py", line 218, in create
    raise TypeNotFound(name)
suds.TypeNotFound: Type not found: 'CalloutAdExtension'

after running

from bingads.v10.bulk import *
iamdoron commented 8 years ago

I had to uninstall bingads and install it again for it to work as expected

imagineful commented 8 years ago

@iamdoron thanks for your feedback. the root cause is that it still uses the old wsdl cache, I repro this error and after I clear the suds cache files the error is gone. Typically the suds cache path would be: C:\Users\AppData\Local\Temp\2\suds.

Thanks. Li.

iamdoron commented 8 years ago

On linux (Ubuntu) I had to run

rm -rf /tmp/suds

another way to solve it is to add a query parameter to the wsdl url every time its content changes (but the url remains the same) https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v10/BulkService.svc?singleWsdl&tmp=1 https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v10/BulkService.svc?singleWsdl&tmp=2 I think these two links would be cached separately