<?php
include_once 'config.inc.php';
// sends a request xml via curl to a server application
// and receives the response as xml
$c = Transfer_Curl::getInstance()
->doPostXML(
"http://www.query4u.de/test/index.php",
'<?xml version="1.0" encoding="UTF-8"?>
<transfer>
<head>
<context>Test</context>
<module>Module</module>
<action>index</action>
<checksum>'.Transfer_Checksum::build("none","Test","Module","index").'</checksum>
<format>xml</format>
<version>0.1.1</version>
</head>
<body>
</body>
</transfer>
');
// transforms and validates the response against a schema
$response = new Transfer_XmlResponse("Test","Module","index");
$response->setSchema("response");
$response->setOutput($c);
$response->render();
if($response->isValid()) {
header("content-type: text/xml");
echo $response->getXml();
} else {
echo "invalid request";
}
|