473,383 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

recieve zip file via xml

Hey guys,

I am connecting to a supllier via SOAP that sends me with the price
list zipped inside an xml message. I can connect and I can retrieve
the xml information (see the message, save the content, etc...)
however i am unable to unzip the information contained in the tag

here is my code:

<code>
<?php

$client = new SoapClient("mywsdl service",array('trace' =1));

$call = $client->__soapCall("Cliente",
array('Cliente'=>array('ncliente'=>"user",'pss'=>" password")));

//Some debugging

echo("\r\nCabecera de la solicitud:\n" .$client-
>__getLastRequestHeaders());
echo("\r\nSolicitud:\n".$client->__getLastRequest());

echo("\r\nCabecera de Respuesta:\n" . $client-
>__getLastResponseHeaders());
echo ("\r\nRespuesta:" . $client->__getLastResponse());
$myFile = "prueba.zip";
$fh = fopen($myFile, 'wb');

fwrite($fh, $call->ClienteRespuesta);

fclose($fh);

?>
</code>

When i try to open the file with zip i get an error. the file has
1024kb so I know there is info in there but i just dont know how to
access it. I have also tried to base64_decode manually before the SOAP
parses the info with no luck.

Thank you for any help.

Dec 24 '07 #1
2 1389
$myFile = "prueba.zip";
$fh = fopen($myFile, 'wb');

fwrite($fh, $call->ClienteRespuesta);
If this really is a SOAP service, it will contain XML. There are a few
ways to send binaries with XML, but a SOAP service will never send a
pure binary as far as I know.
When i try to open the file with zip i get an error. the file has
1024kb so I know there is info in there but i just dont know how to
access it. I have also tried to base64_decode manually before the SOAP
parses the info with no luck.
Just take a look at the saved file. If there is any base64 encoded data
inside, it is given within XML tags. So again, it is not the whole response.

But there is also the possibility that it is an attachment. In that
case, the response is a multipart download. I do not know the SOAP
library enough to be able to tell you if it can handle that. If it can
(which would not surprise me), there is probably a method of the client
object that gives you access to the attachments.

Good luck and a nice christmas,
Dikkie
Dec 24 '07 #2
Thanks Dikkie,

With soap i do retrieve an xml file which i save into $call. I can
reference the tags directly, since the information I want is in the
ClienteRespuesta tag, I write it directly into the file.
fwrite($fh, $call->ClienteRespuesta);
Just take a look at the saved file. If there is any base64 encoded data
inside, it is given within XML tags. So again, it is not the whole response.
AFAIK soap decodes base64 when you access the xml tag. in any case i
have tried decoding manually by debugging the response with the same
result. As you can see in the code above I am extracting the data from
the tags, so there are no tags in the file.

If the file is an attachment how would you handle with xml, i havent
seen anything in soap.
Thanks again and Happy Christmas to you too.
Dec 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: K.K. | last post by:
I am writing program that will recieve or sent data to selected port (users can select which port they want to recieve or sent) but I don't know how or whick object I can use.
2
by: Robin Tucker | last post by:
Hiya, I can't get my panel to recieve mousewheel events at all. When I handle the Mousedown event, I call Me.Focus() in order to have the input focus, but my mousewheel event never fires. Is...
2
by: Jody L. Whitlock | last post by:
I'm kinda stumped at the moment, so... Here's what I'm looking to do: I have a ClientSocket, and I would like to free-thread the recieve end of it. I tried a delegate, but that won't fire. I'm...
1
by: Kiran | last post by:
how to send and recieve objects to java web services from .net client
0
by: Aerodyne | last post by:
Hi all, I have a client that send a text file to a server... the client end seems to work ok. I would like some help on the server side, it's listening fine... but how do I get it to recieve a...
7
by: sreehari | last post by:
Hi All, I have this problem, I have developed a Master - Slave kinda appliacation , were the slave is generally a device.when i broadcast a message from my application, the Device seems to...
2
by: ericlangland | last post by:
Hi, I have a small managed code application (windows forms) that executes on startup and immidiatly minimizes to the system tray. It launches and shows the form when I double click it's small...
1
by: 4project | last post by:
i wanted to design a user interface such that i can handle all the incoming and outgoing calls , also send and recieve sms. I know that for sure that we can 1a .call 2a send sms but not...
2
by: asis.morodo | last post by:
Hey guys, I am connecting to a supllier via SOAP that sends me with the price list zipped inside an xml message. I can connect and I can retrieve the xml information (see the message, save the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.