Hi,
I am new(ish) to this stuff, though I have had to post XML to a remote URL, also an ASP page.
Now, I didn't write the remote page, all I do is assemble the XML document - according to their preferred specification - from values generated by the script, the input form and through queries against a MySQL database.
This is then posted through the HTTP POST mechanism. I can do it one of two ways: Leave a button on the form to let the user post the information, or make it post on an OnLoad() Javascript function call, once the return page has fully loaded into the browser.
My query is that the ASP script at the other end returns, in XML form, details concerning the success - or otherwise - of the posting. This is not a problem for me, so much as for the people who are using the form. They do not wish to see XML appearing in a pop-up window. The issue, therefore, is to find a way of streaming the XML to the remote location from the server which my script is running from. My script should then be able to intercept the returned XML, using it to generate more meaningful messages to the user, which are perceived to be less intrusive than the raw XTML they would otherwise receive.
I have looked at the fopen() functions, though not the later streaming ones, since my PHP installation is version 4.1.x, as opposed to the later versions. I am reluctant to recompile, since it would mean having to pull down all the other associated packages (apache,MySQL, GD, ldap, etc), not to mention various libraries, in order to rebuild them all.
I should also mention at this point that I have the expat parser installed on my linux distro. Unfortunately, PHP was not linked with expat at build time. I downloaded the source, built it and tried to make a shared library that php could use, but this proved fruitless as, if my understanding is correct, php has to be built against expat to make it work. This may be irrelevant, since the XML is generated by the script I wrote and is syntactically correct.
Any help would be greatly appreciated and if I am able to construct a reasonably robust solution through any pointers, I would be more than happy to post it up (with credits to those who helped me), for others to use as they see fit.