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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.
Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.


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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

617 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