Hello,
Thank for the cURL tip, I'll look into that, but I need to look at getting this done using normal PHP for the moment.
I've been trying to use the HttpRequest::METH_POST command, but I get a error back saying :-
Parse error: syntax error, unexpected ')', expecting '(' in d2xml.php on line 192
d2xml.pnp look like this
<?php
if(isset($_POST['create_xml'])){
echo "Links Data Posted";
/* All Links data from the form is now being stored in variables in string format */
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$CrqDateTime=str_replace('%',substr(microtime(),2,7),date('Y-m-d\TH:i:s.%O'));
$CrqDateTime=substr($CrqDateTime,0,-2).':'.substr($CrqDateTime,-2);
$CrqDocName=str_replace('%',substr(microtime(),2,7),date('Y-m-d\TH-i-s.%O'));
$CrqDocName=substr($CrqDocName,0,-2).':'.substr($CrqDocName,-2);
$urlDoc = $CrqDocName;
$url = "
$CrqTestRequest = "Test";
$CrqService = "Identity";
$CrqCompanyID = "TestCompany";
$CrqUserID = "TestUser";
$CrqSearchID = "username";
$CrqPassword = "TestPwd";
$CrqClientRef = "password";
$xmlBeg1 = '<?xml version="1.0" encoding="utf-8"?>';
$xmlBeg2 = '<soap:Envelope xmlns:xds="
xmlns:xsi="
xmlns:soap="
$xmlBeg4 = '<PerformIDCheck xmlns="
url">';
$CrqIntegratorID ="another password";
$xml_document= $xmlBeg1;
$xml_document .= $xmlBeg2;
$xml_document .= "<soap:Body>";
$xml_document .= $xmlBeg4;
$xml_document .= "<CallRequest>";
$xml_document .= "<CrqIntegratorID>";
$xml_document .= $CrqIntegratorID;
$xml_document .= "</CrqIntegratorID>";
$xml_document .= "<CrqTestRequest>";
$xml_document .= $CrqTestRequest;
$xml_document .= "</CrqTestRequest>";
$xml_document .= "<CrqDateTime>";
$xml_document .= $CrqDateTime;
$xml_document .= "</CrqDateTime>";
$xml_document .= "<CrqService>";
$xml_document .= $CrqService;
$xml_document .= "</CrqService>";
$xml_document .= "<CrqCompanyID>";
$xml_document .= $CrqCompanyID;
$xml_document .= "</CrqCompanyID>";
$xml_document .= "<CrqUserID>";
$xml_document .= $CrqUserID;
$xml_document .= "</CrqUserID>";
$xml_document .= "<CrqPassword>";
$xml_document .= $CrqPassword;
$xml_document .= "</CrqPassword>";
$xml_document .= "<CrqSearchID>";
$xml_document .= $CrqSearchID;
$xml_document .= "</CrqSearchID>";
$xml_document .= "<CrqClientRef>";
$xml_document .= $CrqClientRef;
$xml_document .= "</CrqClientRef>";
$xml_document .= "<CrqApplicant>";
$xml_document .= "<AptName>";
$xml_document .= "<Surname>";
$xml_document .= $lastName;
$xml_document .= "</Surname>";
$xml_document .= "<Forename>";
$xml_document .= $firstName;
$xml_document .= "</Forename>";
$xml_document .= "<Title>";
$xml_document .= $email;
$xml_document .= "</Title>";
$xml_document .= "</AptName>";
$xml_document .= "<AptAddress>";
$xml_document .= "<AadBuilding>";
$xml_document .= $phone;
$xml_document .= "</AadBuilding>";
$xml_document .= "<AadStreet>";
$xml_document .= $address1;
$xml_document .= "</AadStreet>";
$xml_document .= "<AadPostTown>";
$xml_document .= $address2;
$xml_document .= "</AadPostTown>";
$xml_document .= "<AadPostCode>";
$xml_document .= $phone;
$xml_document .= "</AadPostCode>";
$xml_document .= "</AptAddress>";
$xml_document .= "</CrqApplicant>";
$xml_document .= "</CallRequest>";
$xml_document .= "</PerformIDCheck>";
$xml_document .= "</soap:Body>";
$xml_document .= "</soap:Envelope>";
$path_dir = "output/";
$path_dir .= $urlDoc .".xml";
/* Data in Variables ready to be written to an XML file */
$fp = fopen($path_dir,'w');
$write = fwrite($fp,$xml_document);
echo ". Posted filename is " .$path_dir;
/* Send File */
$req = &new HttpRequest($url, HttpRequest::METH_POST);
$req->addHeaders(("POST /webpage.asmx HTTP/1.1"));
$req->addHeaders(("Host: ws.webpage2.co.uk"));
$req->addHeaders(("Content-Type:text/xml; charset=utf-8"));
$req->addHeaders(("Content-Length: 999"));
$req->addHeaders(('SOAPAction:"
$req->addPostFile(($url.".xml"));
$req->send();
echo $req->getResponseBody();
/* Send File */
}
?>
line 197 is above the /* send file */ line, so its either the line above that, or below, but both look ok to me.
I KNOW i've typed something in wrong, but for the life of me I cannot see what.
Can someone point out my error to me?
Thanks