How to retrieve data encoded/ compressed  included in a xml fil

Posted on 2011-02-13
Last Modified: 2013-11-18

I must retrieve a product List from the server of a company via a web
I need to show the data on a website (php).

i retrieve the xml file from the webservice and save it into my
webserver but when i want to show the product node, it is coded.

according of the webservice documentation, it's a base64-encoded zip file

How can i do to decode and /or unzip the node of the xml file ???

Thank you for help
Question by:Ok123
  • 3
  • 2

Accepted Solution

wwwdeveloper2 earned 250 total points
ID: 34885097
Have you tried to use the php function base64_decode()?


Author Comment

ID: 34886039
Yes it's the first thing i tried but it remain unreadable.
PK¿¿¿’N>fæÝRŠë¿$aå¿ ¿¿¿35E02B01K.xmlìÝ{sÚH¶¿ðÿS•ï ›û߬úÝÒTÆ[

Open in new window


Assisted Solution

TomLun earned 250 total points
ID: 34886238
The encoded content is a zip-file. Try to save the content to a temporary file and then use the PHP  zip_* functions to read/manipulate it.
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.


Expert Comment

ID: 34891347
Ok123 -

Can you paste some of your source code here?  It might be helpful to assist you.


Author Comment

ID: 34892721

I will find a part of the xml file ....(not all the coded part)

i tried to copy/paste the section between <c_zipfile> ....</c_zipfile> into a text file and tried to
open with PHP zip_.... but no result.
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
	<xsd:schema id="VFPData" xmlns:xsd="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<xsd:element name="VFPData" msdata:IsDataSet="true">
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="crs_answer" minOccurs="0" maxOccurs="unbounded">
								<xsd:element name="c_zipfile">
										<xsd:restriction base="xsd:base64Binary">
											<xsd:maxLength value="2147483647"/>
				<xsd:anyAttribute namespace="" processContents="lax"/>

Open in new window


Author Closing Comment

ID: 34893003
ok i found the solution , i need to decode the node first and after unzip it ... thanks for all

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now