MicrosoftDocs / Advertising-docs

Creative Commons Attribution 4.0 International
15 stars 59 forks source link

Unable to work with GetBillingDocumentsInfo function with python #719

Closed Jor-G-ete closed 4 years ago

Jor-G-ete commented 4 years ago

Hello everyone:

I was trying to retrieve some billing information, in order to extract some data in pdf, with the service CustomerBillingService in python. when a wild mistake appear:

# autorization_data previously created
customer_billing_service = ServiceClient(
            service="CustomerBillingService",
            version=13,
            authorization_data=authorization_data,
            environment="production"
        )
response = customer_billing_service.GetBillingDocumentsInfo(
            AccountIds=[0,1 ,2],
            StartDate=20191101,
            EndDate=None
        )

And ithe following mistake raises up:

{WebFault}Server raised fault: 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/Billing/v13:AccountIds. The InnerException message was 'There was an error deserializing the object of type System.Int64[]. End element 'AccountIds' from namespace 'https://bingads.microsoft.com/Billing/v13' expected. Found text '0'. Line 1, position 2349.'. Please see InnerException for more details.'

Conclusion

What most triggers me, it is that the values of the list in AccountIds are integers ( forced ) but the web server recognices them as text. I guess that something must be wrong with the soap message. Could this hipothesis be checked out?

What Have I tried?

I tried with .NET in concrete with visual basic, and for accounts which have cost, it didn't raise me any error, but it returned me the array empty, which is impossible due to those accounts have cost. : S

Thank you very much for your help

eric-urban commented 4 years ago

Closed per issue 720