XML POST Proxy Script using PHP and libcurl

Written by James McDonald

August 3, 2010

This is the simplest answer I could find for a client needing to POST an XML SOAP message to a server in another domain.

Not sure on the security because the POST isn’t validated so it just passes on whatever the client sends.

libcurl has a lot of options

      echo "
  • $h = $v
  • \n";; */ # tell the client to expect an xml reply header("Content-Type: text/xml"); # then send the the xml reply from the webservice echo $xml; # close the session to free up resources curl_close($session); /* This dumps all the session variables from PHP woo hoo! var_dump(get_defined_vars()); */ ?>


    Submit a Comment

    Your email address will not be published. Required fields are marked *

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    The reCAPTCHA verification period has expired. Please reload the page.

    You May Also Like…