maiiku/EWSWrapper_py — pull request #5 by yscumc (2013-08-28 20:52:51+00:00)
Title: Header can be missing in response

Minor problem which I spent quite some time debugging...

I got the following trace when initializing EWSWrapper:
```
...
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 109, in __init__
self.version = self.Version(self)
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 118, in __init__
self.minorbuildnumber = self.get()
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 193, in get
info = header.find('{%s}ServerVersionInfo' % tns).attrib
AttributeError: 'NoneType' object has no attribute 'find'
```

This was caused by the following response:
```

a:ErrorInvalidServerVersion
The specified server version is invalid.

ErrorInvalidServerVersion
The specified server version is invalid.

```

With this PR applied, it'll look like this instead, which makes debugging much more easily:
```
...
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 109, in __init__
self.version = self.Version(self)
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 118, in __init__
self.minorbuildnumber = self.get()
File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 194, in get
raise Exception('No header in response: %s' % response)
Exception: No header in response: a:ErrorI
nvalidServerVersionThe specified server version is invalid.ErrorInvalidServerVersionThe specified server version i
s invalid.
```

Not sure why the server didn't accept the request as I haven't looked into that yet. Will file as a separate issue.