LongBlob in XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chillyroll
Forum Newbie
Posts: 2
Joined: Wed Nov 29, 2006 10:42 pm

LongBlob in XML

Post 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!!!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: LongBlob in XML

Post 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.
Post Reply