<?php
 
 
include_once 'config.inc.php';
 
 
// sends a request xml via curl to a server application
 
// and receives the response as xml
 
 
$request = new Transfer_XmlRequest("Test","Module","index");
 
$request->setSchema("request");
 
$request->render();
 
 
if($request->isValid()) {
 
    $requestXML = $request->getXml();
 
} else {
 
    echo "invalid request";
 
    exit;
 
}
 
 
$c    = Transfer_Curl::getInstance()
 
            ->doPostXML("http://www.query4u.de/test/index.php",$requestXML);
 
 
 
// 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 response";
 
}
 
 
 
 |