コード例 #1
0
/**
 * Parses for the XML Response in the MIME multipart message.
 * @param string $response MIME multipart message
 * @return string XML Response
 */
function parseForResponseXML($response)
{
    $beginResponseXML = strpos($response, '<?xml');
    $endResponseXML = strpos($response, '</downloadFileResponse>', $beginResponseXML);
    //Assume a service level error and die.
    if ($endResponseXML === FALSE) {
        $errorXML = parseForErrorMessage($response);
        PrintUtils::printXML($errorXML);
        die;
    }
    $endResponseXML += strlen('</downloadFileResponse>');
    return substr($response, $beginResponseXML, $endResponseXML - $beginResponseXML);
}
コード例 #2
0
    global $debug;
    $request = $_POST['userRequest'];
    if (get_magic_quotes_gpc()) {
        $request = stripslashes($request);
    }
    return $request;
}
if (isset($_POST['userRequest'])) {
    $session = new LargeMerchantServiceSession('XML', 'XML', ENV_SANDBOX);
    $request = getRequest();
    $responseXML = $session->sendBulkDataExchangeRequest('startDownloadJob', $request);
    $xml = simplexml_load_string($responseXML);
    if (!empty($xml) && 'Success' == (string) $xml->ack) {
        $id_array = array("JobID" => (string) $xml->jobId);
    }
    PrintUtils::printXML($responseXML);
    parseResponseAndPrintExamples($xml);
}
?>
<hr />
<a href="./../index.php">Index</a>
<?php 
if (!empty($id_array['JobID'])) {
    ?>
<a href="./../GetJobStatus/GetJobStatus.php?jobId=<?php 
    echo $id_array['JobID'];
    ?>
">GetJobStatus</a>
<?php 
}
if (!empty($debug)) {