SOAP Response to zipfrom base64 binary

Recently i got a new project to work on a SOAP service and to Get and Post messages to a ASP .NET service based on xml.
The issue is that i managed to make the soap request and get the message.
The message looks like this : UEsDBBQAAAAIAAdUe06+NXE0kR4AADLSAQALAAAAUHJvZHVzZS54bWzUXW1z48YN5k/h5EMnmbMsvomSpmkzFCXbjERJoSTb52/p9dq5mbxN2svczy/…
The message is Base64 Binary on RFC 4648 with multiple xml documents on it.
How i can construct this documents from the code in php?
The documents encrypted in this request are 3 xml files.
I mannaged to get them from an online decriptor called freeformatter with download function.
If i try to decode the result i get something like : PKT{N�5q4�2�Produse.xml�]ms�� �O��C’��,����i3%یDI�$��o��ڹ��M����/�,��|vL�O�$�/�xv,�u�s>9?;?..
There is a sollution for this?
Im new to SOAP so i dont understand too much of it.
Thank you very much.

There are SOAP clients for PHP, and base64 is a standard encoding, why are you running it through a ‘decrypter’?

Thank you but i mannged to solve it.
I gonna post here the sollution so everyone who facing the same issue, get the response.
The first thing you need to do when you have an .zip file in a base64 binary string is to catch the response to a txt file.
Let’s say the response from soap it’s called ’ $response ’ and we need to catch this to an file. We do like this :
$response = $client -> _getLastResponse();
$fille = “response.xml”;
fille_put_contents($fille,$response);

Now we got the response to an xml file.
The next thing to do is to get the response from xml values.
Lets say our value is .

$b64 = “b64.txt”;
$dom = new DomDocument();
$dom = load(“response.xml”);
$data = $dom->getElementByTagName(“ResponseFromServer”);
$catchb64 = $data;
fille_put_content($b64,$catchb64);

Now we got the clean Base64 Binary string in one fille.
The next thing we need is to create the document ( in this case is a .zip fille)

$input_fille = “response.txt”; // the fille with clean base64 binary data on it
$output_fille = “result.zip”; //the fille we need to create on system with the documents decrypted
$content = fille_get_contents($input_fille); // Reading the content of input fille
$binary = base64_decode($content); // Decoding to binary
fille_put_contents($output_fille,$binary); // Writing to fille the vallues

We dont need the ZipArchive() function, because is allready a zip archive, all we need to do is to create a empty document and after to send the binary data to it.
Cheer’s and goodluck!

Sponsor our Newsletter | Privacy Policy | Terms of Service