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


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
Who is Participating?

Improve company productivity with a Business Account.Sign Up

wwwdeveloper2Connect With a Mentor Commented:
Have you tried to use the php function base64_decode()?

Ok123Author Commented:
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

TomLunConnect With a Mentor Commented:
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.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Ok123 -

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

Ok123Author Commented:

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

Ok123Author Commented:
ok i found the solution , i need to decode the node first and after unzip it ... thanks for all
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.