Binary / SOAPpy
mail at timgolden.me.uk
Fri Jun 8 22:24:35 CEST 2007
Robert Rawlins - Think Blue wrote:
> I have a WebService call which returns an array, the first element in
> that array is the binary for a zip file, however I’m having trouble
> writing that binary string into an actual file when it arrives, I’ve
> tried the following method.
> Result = call to the webservice that returns the array.
> file = open("Zips/1.zip", "wb")
> But this throws the error message:
> TypeError: argument 1 must be string or read-only buffer, not instance
Robert, do the obvious here, and insert:
print type (result)
print repr (result)
after you receive the result and before you open the file.
Is result really what you expected?
By the way, you can't simply throw a zipped string into
a .zip file. The .zip file needs headers and so forth.
Maybe that's not quite what you're trying to do, but
it looks like it.
More information about the Python-list