PHP Classes

QTransfer: Send HTTP requests and process XML responses

Recommend this page to a friend!
  Info   View files View files (16)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 459 All time: 6,060 This week: 199Up
Version License PHP version Categories
qtransfer 0.1.1GNU General Publi...5.0XML, HTTP, PHP 5
Description Author

This package can be used to send HTTP requests and process XML responses.

There is one class that can send and receive HTTP requests and another can process the request responses.

There are also other classes to process the HTTP XML responses.

Picture of Tom Schaefer
  Performance   Level  
Name: Tom Schaefer is available for providing paid consulting. Contact Tom Schaefer .
Classes: 39 packages by
Country: Germany Germany
Age: ???
All time rank: 1088 in Germany Germany
Week rank: 557 Down32 in Germany Germany Down
Innovation award
Innovation award
Nominee: 9x

Winner: 1x


QTransfer is a collection of classes which can be used for exchanging
data in xml format between servers language independently.
You can use it i.e. for ASP or SAAS software application based on php.

The request scheme (xsd) can be delivered to a customer who gets an API
like interface for producing valid xml based requests.

The sample setup demonstrates how to
- setup xsd schemes,
- prepare request xml data streams which request specific application data
- validate incoming responses

Sample Setup Request XML:

	$request = new Transfer_XmlRequest("Test","Module","index");
	$request->render(); // renders the domdocument to string
	if($request->isValid()) {
		$requestXML = $request->getXml(); // pure XML
	} else {
		echo "invalid request";

Q:	What does this piece of code?
A:	It builds a xml and checks its integrity. This xml is laterly send to a server
	which processes the incoming xml structure.

	sample xml output:
	<?xml version="1.0" encoding="UTF-8"?>
				<checksum>--40 chars long checksum string here--</checksum>

Q: Why do I have to validate the request?
A: Suppose you want to deliver some data to a customer from your server. The customer
   only has to know how to send a xml stream to a specific adress and that he will receive
   a xmlml response. He must not know anything about server language etc.. He only
   has to know how to setup his request for being able to receive xml data.
   The validation of the xml, which is send by the customer, is helps to
   avoid failures. If a xml validation fails then he knows that something went
   wrong. The major advantage of such a validation is? A customer's server and the serving host
   must not be speak the same language. So it is language independent.
   You can write PHP and your customer writes JSP, does not matter.

Sample customer request sends the xml to the hosted service front-controller etc.:

	$c	= Transfer_Curl::getInstance()

The variable $c gets the response xml. Now, the response can be validated
against a reponse schema which is parametrized like the request.

	$response = new Transfer_XmlResponse("Test","Module","index");

	if($response->isValid()) {
		header("content-type: text/xml");
		echo $response->getXml();
	} else {
		echo "invalid response";

Now you have the requested results in xml format which can be easily
processed by any system.
  Files folder image Files  
File Role Description
Files folder imagesamples (3 files)
Files folder imageclasses (1 file, 1 directory)
Files folder imageschemes (1 directory)
Accessible without login Plain text file readme Data readme

  Files folder image Files  /  samples  
File Role Description
  Accessible without login Plain text file Conf. sample configuration
  Accessible without login Plain text file index.php Example sample
  Accessible without login Plain text file index2.php Example sample: same as above but shorter

  Files folder image Files  /  classes  
File Role Description
Files folder imageTransfer (7 files)
  Accessible without login Plain text file index.php Aux. include script

  Files folder image Files  /  classes  /  Transfer  
File Role Description
  Plain text file Curl.php Class Curl Object
  Plain text file CurlResponse.php Class CurlResponse Object
  Plain text file XmlRequest.php Class DomXml Request Builder
  Plain text file Checksum.php Class Checksum Builder
  Accessible without login Plain text file index.php Aux. autoloader
  Plain text file Xml.php Class DomXml Working Class
  Plain text file XmlResponse.php Class DomXml Response Builder

  Files folder image Files  /  schemes  
File Role Description
Files folder imagever0.1.1 (4 files)

  Files folder image Files  /  schemes  /  ver0.1.1  
File Role Description
  Accessible without login Plain text file request.xml Data request xml template
  Accessible without login Plain text file request.xsd Data request schema
  Accessible without login Plain text file response.xml Data response xml template
  Accessible without login Plain text file response.xsd Data response schema
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Checksum Download .zip .tar.gz build the checksum for the request and response xml Recommended
 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,060
This week:199Up
For more information send a message to info at phpclasses dot org.