Re: Proper decoding for document returned via SOAP call?

2018-12-12 Thread Bob Miller via 4D_Tech
Uist, Koen -

RE> You will need to use BASE64 DECODE on your returned $Value

Thanks very much, that was exactly what I was looking for!  Works 
perfectly!


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Proper decoding for document returned via SOAP call?

2018-12-12 Thread Koen Van Hooreweghe via 4D_Tech
Hi Bob,

PDF documents are binaries, to be able to send them through a text protocol, 
they are encoded.
In your case it is base64 encoded. So you need to decode the data in the 
getObjectFileReturn tag.

If I understand correctly, you ahve the data part in $Value, then use this 
(from the top of my head):

C_BLOB($pdfBlob)
BASE64 DECODE($Value;$pdfBlob)
BLOB TO DOCUMENT($DocName;$pdfBlob)

HTH
Koen

> Op 12 dec. 2018, om 04:07 heeft Bob Miller via 4D_Tech <4d_tech@lists.4d.com 
> > het volgende geschreven:
> 
> http://DefaultNamespace 
> " 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ 
> " 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ 
> 
> ">http://schemas.xmlsoap.org/soap/encoding/ 
> " xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance 
> " 
> xsi:type="soapenc:base64Binary">JVBERi0xLjMNCjEgMCBvYmoNCjw8DQovVHlwZSAvUGFnZXMgL0NvdW50IDEgL0tpZHMgWyA4IDAgUiBdCj4+DQplbmRvYmoNCjIgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMSAwIFIgL091dGxpbmVzIDExIDAgUiAvUGFnZU1vZGUgL1VzZU91dGxpbmVzID4+DQplbmRvYmoNCjMgMCBvYmoNCjw8DQovQ3JlYXRvciAoQWNyb1Bsb3Qgb24gV2luZGDAwMDAwIG4NCjAwMDAwMDQxNzIgMDAwMDAgbg0KMDAwMDA1NDg0MiAwMDAwMCBuDQowMDAwMDU1MDA2IDAwMDAwIG4NCjAwMDAwNTUxMzcgMDAwMDAgbg0KMDAwMDA1NTIyMyAwMDAwMCBuDQp0cmFpbGVyCjw8DQovU2l6ZSAxMiAvSW5mbyAzIDAgUiAvUm9vdCAyIDAgUiAvSUQgWyA8MEVDNTRDNjQ1MUFCOUYyRkU1MDEwNTdDQ0NGMTYyOTg+DQo8MEVDNTRDNjQ1MUFCOUYyRkU1MDEwNTdDQ0NGMTYyOTg+DQpdCj4+DQpzdGFydHhyZWYNCjU1Mjk5DQolJUVPRgo=
> 
> However, when I take the binary and save it to a file, I can't open it 
> with Adobe PDF reader; it says the file is corrupted.
> 
> I'm thinking that I need to call CONVERT FROM TEXT to somehow change the 
> encoding, but I've tried several of the obvious ones (?ISO-8859-1?; 
> "UTF-8", "UTF-16"; "UTF-32"; "US-ASCII") without any luck.
> 
> DOM GET XML ELEMENT VALUE($aNodeRefsArr{1};$Value)  //this contains the 
> payload I want 
> $DocName:="C:\\TEMP\\OUTPUT.PDF"
> TEXT TO DOCUMENT($DocName;$Value;"US-ASCII")`?ISO-8859-1?; "UTF-8", 
> "UTF-16"; "UTF-32"; "US-ASCII" - none create a document that I can open 
> with Acrobat
> 
> Thoughts?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Proper decoding for document returned via SOAP call?

2018-12-12 Thread Uist Macdonald via 4D_Tech

Hi Bob

You will need to use BASE64 DECODE on your returned $Value, and then 
save it as a doc.


http://doc.4d.com/4Dv16/4D/16.4/BASE64-DECODE.301-3979394.en.html

Regards

Uist


On 12/12/2018 03:07, Bob Miller via 4D_Tech wrote:

Hi Everyone,

I'm confounded by a SOAP service that returns a binary (for a PDF file) -
I'm not able to figure out how to save it as a proper PDF document that
Acrobat understands.


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Proper decoding for document returned via SOAP call?

2018-12-11 Thread Bob Miller via 4D_Tech
Hi Everyone,

I'm confounded by a SOAP service that returns a binary (for a PDF file) - 
I'm not able to figure out how to save it as a proper PDF document that 
Acrobat understands.

I get a SOAP response like (the binary was abridged for readability):

 http://DefaultNamespace; 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/; 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/
">http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance; 
xsi:type="soapenc:base64Binary">JVBERi0xLjMNCjEgMCBvYmoNCjw8DQovVHlwZSAvUGFnZXMgL0NvdW50IDEgL0tpZHMgWyA4IDAgUiBdCj4+DQplbmRvYmoNCjIgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMSAwIFIgL091dGxpbmVzIDExIDAgUiAvUGFnZU1vZGUgL1VzZU91dGxpbmVzID4+DQplbmRvYmoNCjMgMCBvYmoNCjw8DQovQ3JlYXRvciAoQWNyb1Bsb3Qgb24gV2luZGDAwMDAwIG4NCjAwMDAwMDQxNzIgMDAwMDAgbg0KMDAwMDA1NDg0MiAwMDAwMCBuDQowMDAwMDU1MDA2IDAwMDAwIG4NCjAwMDAwNTUxMzcgMDAwMDAgbg0KMDAwMDA1NTIyMyAwMDAwMCBuDQp0cmFpbGVyCjw8DQovU2l6ZSAxMiAvSW5mbyAzIDAgUiAvUm9vdCAyIDAgUiAvSUQgWyA8MEVDNTRDNjQ1MUFCOUYyRkU1MDEwNTdDQ0NGMTYyOTg+DQo8MEVDNTRDNjQ1MUFCOUYyRkU1MDEwNTdDQ0NGMTYyOTg+DQpdCj4+DQpzdGFydHhyZWYNCjU1Mjk5DQolJUVPRgo=

However, when I take the binary and save it to a file, I can't open it 
with Adobe PDF reader; it says the file is corrupted.

I'm thinking that I need to call CONVERT FROM TEXT to somehow change the 
encoding, but I've tried several of the obvious ones (?ISO-8859-1?; 
"UTF-8", "UTF-16"; "UTF-32"; "US-ASCII") without any luck.

DOM GET XML ELEMENT VALUE($aNodeRefsArr{1};$Value)  //this contains the 
payload I want 
$DocName:="C:\\TEMP\\OUTPUT.PDF"
TEXT TO DOCUMENT($DocName;$Value;"US-ASCII")`?ISO-8859-1?; "UTF-8", 
"UTF-16"; "UTF-32"; "US-ASCII" - none create a document that I can open 
with Acrobat

Thoughts?

Many thanks!


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**