diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a3b3ea98c6e..06071f1e9e3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -354,7 +354,8 @@ function top_htmlhead($head, $title="", $target="") //header("Content-type: text/html; charset=UTF-8"); header("Content-type: text/html; charset=iso-8859-1"); - print ''; +// print ''; + print ''; print "\n"; print $langs->lang_header(); @@ -393,9 +394,8 @@ function top_htmlhead($head, $title="", $target="") print ''."\n"; print ''."\n"; - print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; if ($conf->use_javascript || $conf->use_ajax) { diff --git a/htdocs/webservices.php b/htdocs/webservices.php index 26021383e17..469593679e2 100644 --- a/htdocs/webservices.php +++ b/htdocs/webservices.php @@ -29,24 +29,33 @@ require_once("./master.inc.php"); require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP + +dolibarr_syslog("Call Dolibarr webservices interfaces"); + // Create the soap Object $s = new soap_server; // Register a method available for clients $s->register('getVersions'); +// Return the results. +$s->service($HTTP_RAW_POST_DATA); + + + function getVersions() { + dolibarr_syslog("Function: getVersions"); + $versions_array=array(); $versions_array['dolibarr']=DOL_VERSION; $versions_array['mysql']='NA'; + $versions_array['apache']='NA'; return $versions_array; } -// Return the results. -$s->service($HTTP_RAW_POST_DATA); ?> diff --git a/htdocs/webservices_client.php b/htdocs/webservices_client.php index f01519d28f1..c40de08620a 100644 --- a/htdocs/webservices_client.php +++ b/htdocs/webservices_client.php @@ -23,53 +23,53 @@ \file htdocs/webservices_client.php \brief Page demo client appel WebServices Dolibarr \version $Revision$ -*/ +*/ require_once("./master.inc.php"); require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP - -$WS_DOL_URL = $dolibarr_main_url_root.'/webservices.php'; -$WS_METHOD = 'getVersions'; - -// Set the parameters to send to the WebService -$parameters = array("param1"=>"value1"); - -// Set the WebService URL -dolibarr_syslog("Create soapclient for URL=".$WS_DOL_URL); -$soapclient = new soapclient($WS_DOL_URL); -if ($soapclient) -{ - -} - -// Call the WebService method and store its result in $result. -dolibarr_syslog("Call method ".$WS_METHOD); -$result = $soapclient->call($WS_METHOD,$parameters); - -// Show page with result -header("Content-type: text/html; charset=iso-8859-1"); + +$WS_DOL_URL = $dolibarr_main_url_root.'/webservices.php'; +$WS_METHOD = 'getVersions'; + +// Set the parameters to send to the WebService +$parameters = array("param1"=>"value1"); + +// Set the WebService URL +dolibarr_syslog("Create soapclient for URL=".$WS_DOL_URL); +$soapclient = new soapclient($WS_DOL_URL); +if ($soapclient) +{ + +} + +// Call the WebService method and store its result in $result. +dolibarr_syslog("Call method ".$WS_METHOD); +$result = $soapclient->call($WS_METHOD,$parameters); + +// Show page with result +header("Content-type: text/html; charset=utf8"); print ''."\n"; -echo ''."\n"; -echo ''; -echo 'WebService Test: '.$WS_METHOD.''; -echo ''."\n"; - -echo ''."\n"; - -echo "

Question

"; -echo '

Function

'; -echo $WS_METHOD; -echo '

Request

'; -echo '
' . htmlspecialchars($client->request, ENT_QUOTES) . '
'; - -echo "

Réponse

"; -echo '

Result

'; -echo '
';
-print_r($result);
+echo ''."\n";
+echo '';
+echo 'WebService Test: '.$WS_METHOD.'';
+echo ''."\n";
+
+echo ''."\n";
+
+echo "

Question

"; +echo '

Function

'; +echo $WS_METHOD; +echo '

Request

'; +echo '
' . htmlspecialchars($client->request, ENT_QUOTES) . '
'; + +echo "

Réponse

"; +echo '

Result

'; +echo '
';
+print_r($result);
 echo '
'; -echo '

Response

'; -echo '
' . htmlspecialchars($client->response, ENT_QUOTES) . '
'; - -echo ''."\n";; +echo '

Response

'; +echo '
' . htmlspecialchars($client->response, ENT_QUOTES) . '
'; + +echo ''."\n";; echo ''."\n";; -?> +?>