Page 1 of 1

LongBlob in XML

Posted: Mon Apr 28, 2008 12:40 am
by chillyroll
Hello guys,

I want help in returning LongBlob data in XML fro MySQL database. I am writing an API for Document Management and storing entire file in database. When I am returning the .doc file in SOAP response, the file contents stored in the database is affecting the XML structure of the SOAP response, as a result the response is not proper. As a work around, I am returning the contents after using base64_encode(). But i am not sure whether this is the optimal solution or no since for some case it MIGHT break the structure again. Also base64_encode() unnecessarily increasing the size of the response returned.

So, can any one suggest me how to return the LongBlob in SOAP response???

Thanks in advance,
Suhas!!!

Re: LongBlob in XML

Posted: Mon Apr 28, 2008 1:31 am
by John Cartwright
base64 adds about a third of the original data's size to the request (this is unavoidable). Binary data must always be encoded over certain transport layers, i.e. http requests.