Documentation
WEBSERVICE
usage
<GET>
<WEBSERVICE url="uri" method="{get,post}" [format="{xml,html,json,json2xml,text,file}"] [saveas="sushee_path"]>
[<PARAMS [encoding="{UTF-8/ISO-8859-1}"]>
<PARAM name="text">text</PARAM>*
</PARAMS>]<!-- only for the post method -->
[<HEADERS>
<HEADER name="text">text</HEADER>*
</HEADERS>]
/WEBSERVICE>
<
GET>
paramètres
method: HTTP method for sending request. get or post
format: format of the response. XML will be appended in the response tree as received. Text, hml and json will have their entities (&,<,>,") encoded and then returned in the response. File will be saved on the server disk and its meta-information returned (size, path, name). Json2xml allows to receive a json response but to have it automatically transformed to xml.
saveas: allows to save the response in a file on the server disk. The complete path of the destination file must be given.
exemples
<?xml version="1.0" encoding="utf-8"?>
<QUERY>
<GET name="news_aggregator">
<WEBSERVICE url="http://www.nectil.com/Public/news_rss.php" />
</GET>
</QUERY>
<?xml version="1.0" encoding="utf-8"?>
<RESPONSE>
<RESULTS name="news_aggregator">
<WEBSERVICE url="http://www.nectil.com/Public/news_rss.php">
<rss version="0.91">
<channel>
<title>nectil.com News RSS</title>
<link>http://www.nectil.com/Public/</link>
<description>Nectil: environnement de gestion de contenu</description>
<language>fr-BE</language>
<item>
<title>Weekly summary (1)</title>
<link>http://www.nectil.com/Public/TechNews.php?ID=1456</link>
<description>Résumé hebdomadataire des améliorations faites au Kernel</description>
</item>
<item>
<title>Upload intégré!</title>
<link>http://www.nectil.com/Public/TechNews.php?ID=1435</link>
<description>Le dernier rempart HTML est tombé!</description>
</item>
<item>
...
</item>
</channel>
</rss>
</WEBSERVICE>
</RESULTS>
</RESPONSE>
<GET>
<WEBSERVICE url="http://nectil.com/Residents/bruno/Public/command.php" method="post">
<PARAMS>
<PARAM name="articleID">2532</PARAM>
<PARAM name="email">bruno@nectil.com</PARAM>
</PARAMS>
</WEBSERVICE>
</GET>
Calls the page command.php with two parameters articleID and email.
<GET>
<WEBSERVICE url="http://nectil.com/Residents/bruno/Kernel/private/request.php" method="post" format="xml">
<PARAMS>
<PARAM name="NQL">
<QUERY>
<CONNECT>
<LOGIN>boris@nectil.com</LOGIN>
<PASSWORD>*******</PASSWORD>
</CONNECT>
<CREATE>
<CONTACT if-exists="replace">
<INFO>
<FIRSTNAME>Bruno</FIRSTNAME>
<LASTNAME>Verdeyen</LASTNAME>
<EMAIL1>bruno@nectil.com</EMAIL1>
<LANGUAGEID>fre</LANGUAGEID>
</INFO>
</CONTACT>
</CREATE>
</QUERY>
</PARAM>
</PARAMS>
</WEBSERVICE>
</GET>
Connects to specific resident as user boris@nectil.com and creates a new contact on this resident.
Voir aussi :
DOWNLOAD
Download an external file and save it on the sushee disk