Solved

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

Posted on 2011-02-13
6
439 Views
Last Modified: 2013-11-18
Hello,

I must retrieve a product List from the server of a company via a web
service.
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
0
Comment
Question by:Ok123
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

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

http://theserverpages.com/php/manual/en/function.base64-decode.php

0
 

Author Comment

by:Ok123
ID: 34886039
Hello,
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

0
 
LVL 5

Assisted Solution

by:TomLun
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.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:wwwdeveloper2
ID: 34891347
Ok123 -

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

0
 

Author Comment

by:Ok123
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"?>
<VFPData>
	<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<xsd:element name="VFPData" msdata:IsDataSet="true">
			<xsd:complexType>
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="crs_answer" minOccurs="0" maxOccurs="unbounded">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="c_zipfile">
									<xsd:simpleType>
										<xsd:restriction base="xsd:base64Binary">
											<xsd:maxLength value="2147483647"/>
										</xsd:restriction>
									</xsd:simpleType>
								</xsd:element>
							</xsd:sequence>
						</xsd:complexType>
					</xsd:element>
				</xsd:choice>
				<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
			</xsd:complexType>
		</xsd:element>
	</xsd:schema>
	<crs_answer>
		<c_zipfile>
UEsDBBQAAgAIAJIITj5m5t1SiusIACRh5QANAAAAMzVFMDJCMDFLLnhtbOzde3PaSLYA8P9Tle+gm/vfrBL63dJUxlsYNBkmBHsBZza1tXWL.......
.
.
.
</c_zipfile>
	</crs_answer>
</VFPData>

Open in new window

0
 

Author Closing Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hacked File Timestamps 4 51
Mysql sync between 3-4 mysql db 4 25
Randomize in Owl Carousel v1.3.2 6 21
PHP populating an array. 4 5
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

22 Experts available now in Live!

Get 1:1 Help Now