PHP Classes

QTransfer: Send HTTP requests and process XML responses

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 460 All time: 6,088 This week: 673Up
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: 215 Down10 in Germany Germany Down
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

Details

--------- QTransfer --------- 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->setSchema("request"); $request->render(); // renders the domdocument to string if($request->isValid()) { $requestXML = $request->getXml(); // pure XML } else { echo "invalid request"; exit; } 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"?> <transfer> <head> <context>Test</context> <module>Module</module> <action>index</action> <checksum>--40 chars long checksum string here--</checksum> <format>xml</format> <version>0.1.1</version> </head> <body> </body> </transfer> 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() ->doPostXML("http://www.query4u.de/test/index.php",$requestXML); 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"); $response->setSchema("response"); $response->setOutput($c); $response->render(); 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 (16)  
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 (16)  /  samples  
File Role Description
  Accessible without login Plain text file config.inc.php 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 (16)  /  classes  
File Role Description
Files folder imageTransfer (7 files)
  Accessible without login Plain text file index.php Aux. include script

  Files folder image Files (16)  /  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 (16)  /  schemes  
File Role Description
Files folder imagever0.1.1 (4 files)

  Files folder image Files (16)  /  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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadqtransfer-2009-05-17.zip 20KB
Downloadqtransfer-2009-05-17.tar.gz
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  
 0%
Total:460
This week:0
All time:6,088
This week:673Up