Jump to content

Recommended Posts

I am having issues trying to post xml in order to obtain data for use within our system.  My code creates the xml file properly but for some reason a few steps later in the code the variable holding the xml data changes for no apparent reason.  Here's my code and the outputs from echoes

 

$xml_dec = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";

 

$rootELementStart = "<REQUEST_GROUP MISMOVersionID='2.1'>";

 

        $rootElementEnd = "</REQUEST_GROUP>";

 

// $xml_doc =  $xml_dec;

 

$xml_doc .= $rootELementStart;

 

$xml_doc .=  "<RECEIVING_PARTY _Name='".$ProviderID."' />";

 

$xml_doc .=  "<SUBMITTING_PARTY _Name='Liberty Mortgage Funding' />";

 

$xml_doc .=  "<REQUEST InternalAccountIdentifier='".$InternalAcctID."' LoginAccountIdentifier='".$AcctID."' LoginAccountPassword='".$AcctPassword."' RequestDateTime='".$today."' >";

 

$xml_doc .= "<REQUEST_DATA>";

 

$xml_doc .=  "<CREDIT_REQUEST LenderCaseIdentifier='".$LenderCaseID."' MISMOVersionID='2.1' RequestingPartyRequestedByName='".$session_username."'>";

 

$xml_doc .=  "<CREDIT_REQUEST_DATA BorrowerID='".$BorID."' CreditReportIdentifier='' CreditReportRequestActionType='Submit' CreditRequestType='Single'>";

 

$xml_doc .=  "<CREDIT_REPOSITORY_INCLUDED _EquifaxIndicator='Y' _ExperianIndicator='Y' _TransUnionIndicator='Y' />";

 

        $xml_doc .=  "<CREDIT_SCORE_MODEL_NAME _Type='EquifaxBeacon' />";

 

        $xml_doc .=  "<CREDIT_SCORE_MODEL_NAME _Type='TransUnionEmpirica' />";

 

        $xml_doc .=  "</CREDIT_REQUEST_DATA>";

 

$xml_doc .=  "<LOAN_APPLICATION>";

 

        $xml_doc .=  "<BORROWER BorrowerID='Borrower' _FirstName='New' _LastName='Aold' _MiddleName='' _NameSuffix='' _SSN='424384212'>";

 

        $xml_doc .=  "<_RESIDENCE BorrowerResidencyType='Current' _City='Jeffersonville' _PostalCode='47130' _State='IN' _StreetAddress='728 Briscoe Drive' />";

 

        $xml_doc .=  "</BORROWER>";

 

        $xml_doc .=  "</LOAN_APPLICATION>";

 

$xml_doc .=  "</CREDIT_REQUEST>";

 

$xml_doc .=  "</REQUEST_DATA>";

 

$xml_doc .=  "</REQUEST>";

 

$xml_doc .=  $rootElementEnd;

 

$default_dir = "XMLFiles/";

 

$default_dir .=  $xmlfileName .".xml";

 

$fp = fopen($default_dir,'w');

 

 

        $write = fwrite($fp,$xml_doc);

 

 

//Attempt to post the previously created xml file to the equifax url provided

 

$protocol = 'HTTP/1.1';

$URL = 'https://emsws.equifax.com';

$pathToFolder = '/emsws/services/post/MergeCreditWWW';

$contentType = 'text/xml';

$requestBody = $xml_doc;

echo $requestBody;

 

the variable $xml_doc is holding the xml data and it writes everything to a file properly, but when I look at the echo $requestBody

all i get is the following line

<_RESIDENCE BorrowerResidencyType='Current' _City='Jeffersonville' _PostalCode='47130' _State='IN' _StreetAddress='728 Briscoe Drive' />

 

even if i make the $xml_doc one continuous line I still only get this fragment in my echo.  What could be causing this.  I'm new to xml posting so this is all a first for me.  Any help would be greatly appreciated

 

Link to comment
https://forums.phpfreaks.com/topic/87421-php-posting-xml/
Share on other sites

ok I've gotten past the point of reading the xml file into a variable to attempt to post it.  But I've noticed looking at my phpinfo(), that https is turned off, but openssl is enabled.  Will having https off keep me from being able to post data?  If so how do I go about enabling that option?  any help, suggestions?

Link to comment
https://forums.phpfreaks.com/topic/87421-php-posting-xml/#findComment-448245
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.