Welkom. Uw laatste bezoek was vrijdag 18 mei 2012 03:03.
Dit onderwerp heeft nog geen reacties, en bestaat uit 1 pagina.
Dit onderwerp is geplaatst op 31-05-2005 16:07.
HTTP request example scripts
- Geplaatst op dinsdag 31 mei 2005 16:07AdminWebservices.nl crewHere we explain how to make use of the services offered by Webservices.nl via simple HTTP GET or POST requests. The example scripts are written in PHP, but any programming language that can make HTTP GET requests could be used.
HTTP GET
The base URL for GET requests is:
https://ws1.webservices.nl/rpc/get-outputtype/
Output can be returned in several formats, indicated by 'outputtype' in the base URL. 'outputtype' can be one of the following:
- serialized The output will be in serialized php format.
- simplexml The output will be in a very simple xml format which is easy to parse.
- xmlrpc Output is returned in XML-RPC format.
The base URL is followed by the name of the method we would like to invoke, including the method arguments seperated by forward slashes:
'/methodname/username/password/argument1/argument2/ ... /lastargument'
In case an expected argument is an array it is assumed that the input given is a string with comma's seperating the different array values.
Example
This is the URL we would use to call 'addressReeksPhraseSearch' in order to search for 'wilhelminastraat' (page 1 of search results is requested):
https://ws1.webservices.n...ssword/wilhelminastraat/1
HTTP POST
The base URL for POST requests is:
https://ws1.webservices.nl/rpc/serialized-outputtype/
Output can be returned in several formats, indicated by 'outputtype' in the base URL. 'outputtype' can be one of the following:
- serialized The output will be in serialized php format.
- simplexml The output will be in a very simple xml format which is easy to parse.
- xmlrpc Output is returned in XML-RPC format.
The input should be an array in php serialized format. The first entry in the array should have 'methodName' as key and the name of the method to invoke as value. The second entry in the input array should have 'params' as key and an array of all method arguments as value. As in the case of HTTP GET, the first two arguments are always username and password.
Example
To get page 1 of search results for 'wilhelminastraat' using 'addressReeksPhraseSearch' the input would be:
code:1 2 3 4 5 6 7
$args = serialize( array( 'methodName' => 'addressReeksPhraseSearch', 'params' => array('username', 'password', 'wilhelminastraat', 1) ) );
All methods available via SOAP or XML-RPC are also available through via HTTP requests. The first two method arguments are always username and password, the remaining arguments are the same as for the SOAP methods. For SOAP documentation see this topic.
For a list (in xml format) of methods accessible via HTTP requests see also:
https://ws1.webservices.nl/rpc/get-simplexml/system.listMethods
The required parameters (in xml format) for a method can be found by appending the methodname to the following url:
https://ws1.webservices.nl/rpc/get-simplexml/system.methodParameters/Maarten wijzigde dit bericht op 15-08-2007 10:33 met 130%
Dit onderwerp heeft nog geen reacties, en bestaat uit 1 pagina.
Dit onderwerp is geplaatst op 31-05-2005 16:07.