googleads/googleads-python-lib — pull request #21 by tly1980 (2014-08-07 05:28:53+00:00)
Title: HTTP header "Authorization" is missing when https_proxy is set in the yaml config.

I use following code to initiate the DFP client, it works just fine if I don't need proxy server.
```
def dfp_client(auth_file='./auth.yaml'):
client = dfp.DfpClient.LoadFromStorage(auth_file)
return client

client = dfp_client()
li_service = client.GetService('LineItemService', version='v201403')
...
...
```

However, the code breaks when the proxy server is set in auth.yaml
```
dfp:
application_name: Awesome App
client_id: MYCLIENT_ID
client_secret: MYCLIENT_SECRET
refresh_token: MYREFRESH_TOKEN
network_code: 1234
https_proxy: 'http://localhost:8888'
```

The error I've got is:
```suds.WebFault: Server raised fault: '[AuthenticationError.MISSING_AUTHENTICATION @ ]'```

And then I set the logging level to DEBUG, and I can see "Authorization" is missing in the suds.client headers. "Authorization" header was there if I disable the proxy.

```
DEBUG:suds.client:headers = {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.transport.http:sending:
URL: https://www.google.com/apis/ads/publisher/v201403/LineItemService
HEADERS: {'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'Content-type': 'text/xml; charset=utf-8', 'Soapaction': '""'}
MESSAGE:
5129Awesome App (DfpApi-Python, googleads/1.0.6, Python/2.7)WHERE id = :id LIMIT 500 OFFSET 0idTextValue155559071
DEBUG:suds.client:HTTP failed - 500 - Internal Server Error:
soap:Server[AuthenticationError.MISSING_AUTHENTICATION @ ][AuthenticationError.MISSING_AUTHENTICATION @ ]ApiExceptionAuthenticationError.MISSING_AUTHENTICATIONAuthenticationErrorMISSING_AUTHENTICATION
DEBUG:suds.metrics:soap:Server[AuthenticationError.MISSING_AUTHENTICATION @ ][AuthenticationError.MISSING_AUTHENTICATION @ ]ApiExceptionAuthenticationError.MISSING_AUTHENTICATIONAuthenticationErrorMISSING_AUTHENTICATION
sax duration: 1 (ms)
```