diff --git a/htdocs/webservices/demo_wsclient_invoice.php b/htdocs/webservices/demo_wsclient_invoice.php index f740e3709f7..60d882b26ba 100755 --- a/htdocs/webservices/demo_wsclient_invoice.php +++ b/htdocs/webservices/demo_wsclient_invoice.php @@ -31,6 +31,7 @@ require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP $WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_invoice.php'; $WS_METHOD1 = 'getInvoice'; $WS_METHOD2 = 'getInvoicesForThirdParty'; +$ns='http://www.dolibarr.org/ns/'; // Set the WebService URL @@ -39,11 +40,13 @@ $soapclient1 = new nusoap_client($WS_DOL_URL); if ($soapclient1) { $soapclient1->soap_defencoding='UTF-8'; + $soapclient1->decodeUTF8(false); } $soapclient2 = new nusoap_client($WS_DOL_URL); if ($soapclient2) { $soapclient2->soap_defencoding='UTF-8'; + $soapclient2->decodeUTF8(false); } // Call the WebService method and store its result in $result. @@ -56,7 +59,7 @@ $authentication=array( $parameters = array('authentication'=>$authentication,'id'=>1,'ref'=>''); dol_syslog("Call method ".$WS_METHOD1); -$result1 = $soapclient1->call($WS_METHOD1,$parameters); +$result1 = $soapclient1->call($WS_METHOD1,$parameters,$ns,''); if (! $result1) { print $soapclient1->error_str; @@ -65,7 +68,7 @@ if (! $result1) $parameters = array('authentication'=>$authentication,'idthirdparty'=>'1'); dol_syslog("Call method ".$WS_METHOD2); -$result2 = $soapclient2->call($WS_METHOD2,$parameters); +$result2 = $soapclient2->call($WS_METHOD2,$parameters,$ns,''); if (! $result2) { print $soapclient2->error_str; diff --git a/htdocs/webservices/demo_wsclient_other.php b/htdocs/webservices/demo_wsclient_other.php index 0c08265eb62..32029f6caa1 100755 --- a/htdocs/webservices/demo_wsclient_other.php +++ b/htdocs/webservices/demo_wsclient_other.php @@ -30,6 +30,7 @@ require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP $WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_other.php'; $WS_METHOD = 'getVersions'; +$ns='http://www.dolibarr.org/ns/'; // Set the WebService URL @@ -38,6 +39,7 @@ $soapclient = new nusoap_client($WS_DOL_URL); if ($soapclient) { $soapclient->soap_defencoding='UTF-8'; + $soapclient->decodeUTF8(false); } // Call the WebService method and store its result in $result. @@ -49,7 +51,7 @@ $authentication=array( 'entity'=>''); $parameters = array('authentication'=>$authentication); dol_syslog("Call method ".$WS_METHOD); -$result = $soapclient->call($WS_METHOD,$parameters); +$result = $soapclient->call($WS_METHOD,$parameters,$ns,''); if (! $result) { print $soapclient->error_str; diff --git a/htdocs/webservices/demo_wsclient_thirdparty.php b/htdocs/webservices/demo_wsclient_thirdparty.php index b3a9cf9c70c..969e25f5f48 100755 --- a/htdocs/webservices/demo_wsclient_thirdparty.php +++ b/htdocs/webservices/demo_wsclient_thirdparty.php @@ -30,6 +30,7 @@ require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP $WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_thirdparty.php'; $WS_METHOD = 'getThirdParty'; +$ns='http://www.dolibarr.org/ns/'; // Set the WebService URL @@ -38,6 +39,7 @@ $soapclient = new nusoap_client($WS_DOL_URL); if ($soapclient) { $soapclient->soap_defencoding='UTF-8'; + $soapclient->decodeUTF8(false); } // Call the WebService method and store its result in $result. @@ -49,7 +51,7 @@ $authentication=array( 'entity'=>''); $parameters = array('authentication'=>$authentication,'id'=>0,'name'=>'aaa'); dol_syslog("Call method ".$WS_METHOD); -$result = $soapclient->call($WS_METHOD,$parameters); +$result = $soapclient->call($WS_METHOD,$parameters,$ns,''); if (! $result) { print $soapclient->error_str; diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index b5db639015c..ff82b33d4db 100755 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -46,6 +46,7 @@ if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) // Create the soap Object $server = new nusoap_server(); $server->soap_defencoding='UTF-8'; +$server->decode_utf8=false; $ns='http://www.dolibarr.org/ns/'; $server->configureWSDL('WebServicesDolibarrInvoice',$ns); $server->wsdl->schemaTargetNamespace=$ns; @@ -212,11 +213,6 @@ function getInvoice($authentication,$id,$ref,$ref_ext) $error++; $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; } - if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) - { - $error++; - $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; - } if (! $error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext))) { diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 1f6b9635e24..ba478f1bc6f 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -46,6 +46,7 @@ if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) // Create the soap Object $server = new nusoap_server(); $server->soap_defencoding='UTF-8'; +$server->decode_utf8=false; $ns='http://www.dolibarr.org/ns/'; $server->configureWSDL('WebServicesDolibarrOther',$ns); $server->wsdl->schemaTargetNamespace=$ns; @@ -111,11 +112,6 @@ function getVersions($authentication) $error++; $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; } - if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) - { - $error++; - $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; - } if (! $error) { diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 65c15d04897..996b84a6542 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -46,6 +46,7 @@ if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) // Create the soap Object $server = new nusoap_server(); $server->soap_defencoding='UTF-8'; +$server->decode_utf8=false; $ns='http://www.dolibarr.org/ns/'; $server->configureWSDL('WebServicesDolibarrThirdParty',$ns); $server->wsdl->schemaTargetNamespace=$ns; @@ -153,11 +154,6 @@ function getThirdParty($authentication,$id,$ref,$ref_ext) $error++; $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both."; } - if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) - { - $error++; - $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; - } if (! $error) {