Closed radulucaciu closed 9 years ago
Hi, are you using the 'production' env? I tried to reproduce locally, but haven't see the same error. do you have any problems when using other bingads services?
For the exceptions: could you please add a try block to catch the exceptions? below is an example: try: campaign_service = ServiceClient( 'CampaignManagementService', authorization_data=authorization_data, environment=BING_ENVIRONMENT ) print(campaign_service.service_url) except suds.WebFault as ex:
...
Thanks.
Regarding No handlers could be found for logger "suds.client", you can import logging as shown in this example: https://github.com/bing-ads-sdk/BingAds-Python-SDK/blob/master/examples/BingAdsPythonExamplesConsole/BingAdsPythonExamplesConsole/SearchUserAccounts.py#L9
9 #import logging 10 #logging.basicConfig(level=logging.INFO) 11 #logging.getLogger('suds.client').setLevel(logging.DEBUG)
I hope this helps!
Hi gents
Yes, I am using the 'production' environment I am away from a computer now, but will try the suggestions and come back with more info.
Hi I tried again today on my workstation, it works well on my side, for your function definition: def _build_campaign_service(self, account_id, customer_id) it will return a campaign_service instance without error. And I added more test to check if the methods of campaign service can work. Not sure what authentication method you are using, here I use PasswordAuthentication. below is my code:
def _build_campaign_service(account_id, customer_id):
authorization_data = AuthorizationData(
account_id=ACCOUNT_ID,
customer_id=CUSTOMER_ID,
developer_token=DEVELOPER_TOKEN,
authentication=PasswordAuthentication(user_name=USER_NAME, password=PASSWORD)
)
campaign_service = ServiceClient(
'CampaignManagementService',
authorization_data=authorization_data,
environment='production'
)
return campaign_service
test_campaign = _build_campaign_service(ACCOUNT_ID, CUSTOMER_ID)
test_get_campaigns = test_campaign.GetCampaignsByAccountId(ACCOUNT_ID)
I checked test_get_campaigns, it returned all the campaigns under the account id.
Thanks.
Hi, this is quite weird:
ipdb> campaign_service
*** MethodNotFound: Method not found: 'CampaignManagementService.BasicHttpBinding_ICampaignManagementService.__repr__'
ipdb> campaign_service.service_url
'https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v9/CampaignManagementService.svc?singleWsdl'
It seems that it actually works - the reason I thought it was hanging was that, using this code to pull all the campaigns, it took a very long time to return all of them (10+ minutes), even though they are less than ten campaigns, all in the last 6 months.
I can't explain the error above - I am using the Oauth method and am getting the same issue both on my local development box and on our server (both are Ubuntu 12.x machines) I am using the following package versions.
bingads==9.3.4
suds-jurko==0.6
Oh well, as long as it works... I don't know if it's worth investigating this issue any further since I can get the results, I think it can be closed. However, if I could be of any use to help debugging it, I'd love to help.
Thanks for the suggestions!
Thanks. If you have further problems please feel free to let us know.
Hello,
I am getting the following error
*** MethodNotFound: Method not found: 'CampaignManagementService.BasicHttpBinding_ICampaignManagementService.__repr__'
when trying to get a CampaignManagementService. The troublesome code being used is this:All parameters for the call seem to be populated correctly. One more weird thing is that the only output I get is
No handlers could be found for logger "suds.client"
, nothing else, and the application just hangs at that point. The only way I could see the error was by usingipdb.set_trace()
I do not know where to start debugging the issue, any pointers would be greatly appreciated!