I have written a client in c# that communicates with my webservice that I have written in PHP accessing mySQL. I am using SOAP to communicate. Everything works great... but now I would like to take a file on the server, serialize it and send it back to my client embedded in the XML.
I have had no luck finding any information on serializing a file. From what I have read you cannot serialize a resource. There must be a way to read out a file and serialize the bitstream... any help, ideas or suggestions regarding this would be greatly appreciated.
Serialize a File for Webservice
Moderator: General Moderators
Re: Serialize a File for Webservice
I think I may have a solution... I am just going to open the file into an array ($lines = file('http://www.example.com/');) and then serialize the array. Nt the slickest solution but i think it will work... to make things easier on the client I could append this array into a giant string before serializing it but I am not sure about size restrictions for strings in PHP.
Sometimes you just need to talk something out to get the solution... I think they call that rubber-ducking.
Sometimes you just need to talk something out to get the solution... I think they call that rubber-ducking.