Storing binary data in xml file msxml and sending it to client through winsock
-
Hi, I am developing a win32 console project for a smart device which acts as server in which I need to send jpeg file (binary data) stored in XML file to be transferred to client (in PC)through winsock. I am using fopen(),fscanf() to read the data in jpeg file into a buffer to be stored into the XML file element using put_text() and even I need to send it through socket by again reading the .xml file uisng fread into some buffer and sending it to the client. But I am failing when I try to validate the XML file which is giving error :XML Parsing Error: not well-formed Location: http://www.w3schools.com/xml/xml\_validator.asp Line Number 1, Column 197: And also if I try to send some .xml file formed on server to client through winsoch using fread() I am getting the error like :Invalid at the top level of the document. Error processing resource 'file:///C:/Documents and Settings/root/My Documents/PC... Below is the .xml file which I need to transfer Plz kindly respond me in time wht steps shud be done for storing binary data into .xml file and sending the .xml file generated through socket using fread(). Thanks in advance for any help........ Regards, Hema. ======================================================================================================================_________________________________________________________________________________________ .xml file: <MobData><Application><UID/><Name/></Application><Report><CurrentTestSuiteID>1</CurrentTestSuiteID><CurrentTestCycleID>1</CurrentTestCycleID><CurrentTestCaseID>1</CurrentTestCaseID><ImageData>ÿØÿàJFIF ÿþ*Cris made this JPEG with his own encoderÿÛ„ $.' ",#(7),01444'9=82<.342 2!!22222222222222222222222222222222222222222222222222ÿÀ @ð ÿÄ ¢ </ImageData></Report></MobData>
-
Hi, I am developing a win32 console project for a smart device which acts as server in which I need to send jpeg file (binary data) stored in XML file to be transferred to client (in PC)through winsock. I am using fopen(),fscanf() to read the data in jpeg file into a buffer to be stored into the XML file element using put_text() and even I need to send it through socket by again reading the .xml file uisng fread into some buffer and sending it to the client. But I am failing when I try to validate the XML file which is giving error :XML Parsing Error: not well-formed Location: http://www.w3schools.com/xml/xml\_validator.asp Line Number 1, Column 197: And also if I try to send some .xml file formed on server to client through winsoch using fread() I am getting the error like :Invalid at the top level of the document. Error processing resource 'file:///C:/Documents and Settings/root/My Documents/PC... Below is the .xml file which I need to transfer Plz kindly respond me in time wht steps shud be done for storing binary data into .xml file and sending the .xml file generated through socket using fread(). Thanks in advance for any help........ Regards, Hema. ======================================================================================================================_________________________________________________________________________________________ .xml file: <MobData><Application><UID/><Name/></Application><Report><CurrentTestSuiteID>1</CurrentTestSuiteID><CurrentTestCycleID>1</CurrentTestCycleID><CurrentTestCaseID>1</CurrentTestCaseID><ImageData>ÿØÿàJFIF ÿþ*Cris made this JPEG with his own encoderÿÛ„ $.' ",#(7),01444'9=82<.342 2!!22222222222222222222222222222222222222222222222222ÿÀ @ð ÿÄ ¢ </ImageData></Report></MobData>