[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enhancement request for module HTTPXMLR4



Hi Thomas,


If I understand what you're saying about http_parse_xml_raw(), I'm not 
sure that it'll help?  It'll work okay if the response is an ordinary 
SOAP message, but if the result contains attachments, you'd have to 
receive the whole thing in your own callback in order to figure out 
which part is the SOAP -- and since it contains attachments, that could 
potentially be many megabytes (maybe even gigabytes) of data.  I 
wouldn't want to try to store that in memory!

Hmmm...  I wonder if it wouldn't make more sense to use 
http_url_post_raw2() and simply write the output to a temporary stream 
file?   Then call http_header() to determine if it's MIME encoded or 
not, and it it's MIME encoded, run the stream file through a MIME 
decoder (which would have to be written.) Ultimately, the MIME decoder 
would get the SOAP message, and you could run it through 
http_parse_xml_string() or http_parse_xml_stmf().  If it's not MIME 
encoded, of course, you could run the XML through http_parse_xml_stmf() 
to begin with.

Does that make sense, or have you a better way?

thomas.raddatz@xxxxxx wrote:
> 
> Hi Scott,
> 
> I am still trying to make WSDL2RPG to work with attachments. In order to
> become more flexible I now use http_url_post_raw2() to send and receive
> HTTP request. Because of that I added http_parse_xml_raw() to HTTPAPI which
> I call from the save procedure specified at http_url_post_raw2().
> 
> In order to get http_parse_xml_raw() working I also added the following
> procedure:
> 
>    http_parser_init()
>    http_parser_free()
> 
> Beside some minor changes, such as the list of exported items in
> HTTPAPI1+2, the only module I had to change was HTTPXMLR4. Is it possible
> that you adopt these changes to your HTTPAPI project?
> 
> The benefit of these changes is that you can easily create a parser, parse
> a buffer and finally free resources by calling:
> 
>    http_parser_init(peEncoding: peStartProc: peEndProc: peUsrDta)
>    http_parse_xml_raw(peFD: peData: peLength)  // peFD is for compatibility
> to other write() procedures
>    http_parser_free()
> 
> This way I hope that I wil be able to look at the HTTP response stream,
> determine its "flavour" and in case of "SOAP with attachments" delay
> parsing until the SOAP part has been received. All other attachments could
> go into the IFS. So far the theory.
> 
> Regards,
> 
> Thomas.
> 
> 
> --
> IMPORTANT NOTICE:
> This email is confidential, may be legally privileged, and is for the
> intended recipient only. Access, disclosure, copying, distribution, or
> reliance on any of it by anyone else is prohibited and may be a criminal
> offence. Please delete if obtained in error and email confirmation to the sender.
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> 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
-----------------------------------------------------------------------