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

Re: Enhancement request for module HTTPXMLR4



Hi Scott,

What you suggested is almost the same of what I have in mind. The main difference is that I want to
to avoid writing an IFS file in case that is is a 'simple' SOAP message with no attachments. In that case I want to forward the HTTP response stream directly to the parser. That means that the receiving callback procedure have to recognize the incoming HTTP stream and the forward it either to the parser or to an IFS file. Is that a reasonable idea?

Regards,

Thomas.

Scott Klement schrieb:
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
-----------------------------------------------------------------------

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------