[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Posting pdf file
So you did, what i explained? was i of any help?
On Thu, Feb 11, 2010 at 2:39 PM, Shahar Mor <[1]shahar@xxxxxxxxxx>
wrote:
Sorry for my bad explanation, I already solved the issue but
briefly describe problem and solution:
- I need to access web service that recieves pdf and distribute it
either to fax, mail or "external safe"
- The web service recieves several xml elements one is a base64
representation of the file I want to distribute.
- The web services response contains the id and status for my
distribution.
So following suggestion from group I did,
* Created temporary file in the ifs
* Wrote start of soap message to the temp ifs file.
* opened the attachment (pdf file) read chubks of data , converted
to base 64 and wrote to the temp file.
* Added soap "footer" to the temporary file
* used http_post_stmf_xml with the temp file.
* The response is handeled in the procedure.
If someone is interested I can provide the program source file.
Thanks
-----Original Message-----
From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
Klement
Sent: Thursday, February 11, 2010 4:00 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Posting pdf file
I must not be understanding you. HTTPAPI will save the response to a
stream file ("IFS file") automatically. Why do you need to write the
header, data and footer to the file yourself?
Unless.. are you SENDING (instead of receiving) the PDF file? That
would seem a strange thing to do, since web services don't typically
receive data in PDF format. But, perhaps yours is a document
archiving web service or something like that.
But then you talk about expat -- and you wouldn't need to run Expat on
something you're SENDING... only something you're receiving, right?
So I'm not understanding your scenario.
But, if you are receiving the data (Rather than sending) I would
recommend turning on the "return pointer" feature of HTTPAPI's XML
parser so you can receive data that's longer than 64k. That way you
can simply receive the base64 encoded PDF as one big chunk in your XML
handler, and can write it to an IFS file painlessly.
Then you'll need to base64 decode it... IF you don't know how,
please ask.
Shahar Mor wrote:
> Hello all,
>
>
>
> Iam trying to find an example for doing the following - call web
> service that includes a pdf file in base64 the pdf file can be as
long
> as 2 to 3 mb. The result is straight forward (i.e it can be
handeled
> by the xpat handling procedure.
>
>
>
> since the longest variable length is 65535 bytes i thought on the
> following,
>
>
>
> * Create temporary ifs file (http_tempfile ?)
>
> * write header of soap to the ifs file
>
> * write encoded base64 of the pdf file to the ifs file.
>
> * write footer of soap message.
>
> * run the web service from the stream file.
>
>
>
> Did anybody tried this ?
>
> What is the api to use in order to send request with soapaction
using
> stream file and getting response to xpat procedure ?
>
>
>
> Thanks
>
>
>
>
----------------------------------------------------------------------
> --
>
>
----------------------------------------------------------------------
> - This is the FTPAPI mailing list. To unsubscribe, please go to:
> [4]http://www.scottklement.com/mailman/listinfo/ftpapi
>
----------------------------------------------------------------------
> -
----------------------------------------------------------------------
-
This is the FTPAPI mailing list. To unsubscribe, please go to:
[5]http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-
----------------------------------------------------------------------
-
This is the FTPAPI mailing list. To unsubscribe, please go to:
[6]http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-
--
Thanks,
Musthafa
References
1. mailto:shahar@xxxxxxxxxx
2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
4. http://www.scottklement.com/mailman/listinfo/ftpapi
5. http://www.scottklement.com/mailman/listinfo/ftpapi
6. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------