I am posting xml using curl and it isn't being read by the receiving server correctly.
The server is receiving the post as a array it sees
Code: Select all
array(1) {
["<?xml_version"]=>
string(972) "\"1.0\"?>
<REQUEST_GROUP MISMOVersionID=\"2.1\">
<REQUEST LoginAccountIdentifier=\"testuser\" LoginAccountPassword=\"Password\">
<KEY _NAME=\"MemberID\" _Value=\"100\"/>
<REQUEST_DATA>
<CREDIT_REQUEST MISMOVersionID=\"2.1\">
<CREDIT_REQUEST_DATA CreditRequestID=\"CRReq0001\" BorrowerID=\"BorRec0001\" CreditReportRequestActionType=\"Submit\" CreditReportType=\"Consumer\" CreditRequestType=\"Individual\">
<CREDIT_REPOSITORY_INCLUDED _EquifaxIndicator=\"N\" _ExperianIndicator=\"Y\" _TransUnionIndicator=\"N\"/>
</CREDIT_REQUEST_DATA>
<LOAN_APPLICATION>
<BORROWER BorrowerID=\"BorRec0001\" _FirstName=\"EVPAULA\" _MiddleName=\"\" _LastName=\"Consumer\" _SSN=\"376988419\">
<_RESIDENCE _StreetAddress=\"10655 Birch St\" _City=\"Burbank\" _State=\"Ca\" _PostalCode=\"20906\"/>
</BORROWER>
</LOAN_APPLICATION>
</CREDIT_REQUEST>
</REQUEST_DATA>
</REQUEST>
</REQUEST_GROUP>
"
}Code: Select all
$ch= curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept: text/xml"));
curl_setopt($ch, CURLOPT_URL, "http://www.horowitzfamily.net/test_data.php");
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlResult);
curl_setopt($ch, CURLOPT_POST,1);
curl_exec($ch)
My first question is should the xml be posted as an array. I know a normal post is. I'm not sure if my issue is my post or on the receiving server. What their tech support is telling me is they are looking for the xml to be posted as a dom object.
Thanks for any help.
Everah | Please use bbCode tags when posting code in the forums.