Bug #69515 [NEW]: Error on Zend SOAP (sorry if duplicated)
| From: | jorgeley at gmail dot com | Date: | Thu, 23 Apr 2015 14:54:09 +0000 |
| Subject: | Bug #69515 [NEW]: Error on Zend SOAP (sorry if duplicated) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192298@lists.php.net to get a copy of this message | ||
From: jorgeley at gmail dot com
Operating system: Linux
PHP version: 5.5Git-2015-04-23 (snap)
Package: SOAP related
Bug Type: Bug
Bug description:Error on Zend SOAP (sorry if duplicated)
Description:
------------
(sorry if duplicated)
Got an error when my SOAP class client return special characters.
When my data on database has no special chars everything is fine, but if
I have some special chars "ç, ~" the bug happens.
Test script:
---------------
<?php
//WebserviceController.php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController,
Zend\View\Model\ViewModel,
Zend\Soap\Client as SoapClient;
class WebserviceController extends AbstractActionController{
private static $SERVIDOR = "192.168.1.103:8888"; //my server
private $_WSDL_URI =
"http://192.168.1.103:8888/WEB/GPA/public/webservice";
public function autenticaAction(){
$cliente = new SoapClient($this->_WSDL_URI.'/wsdl');
$usuario = $cliente->autentica("jorgeley","123"); //my
credentials on database
return = new ViewModel(array('autentica' => $usuario));
}
//my WSDL
public function WsdlAction() {
$wsdl = new AutoDiscover();
$wsdl->setClass('\Application\Webservices\gpa')
->setUri($this->_WSDL_URI.'/soap');
$wsdl->handle();
}
//my SOAP
public function soapAction(){
$soap = new Soap(null, array('uri' => $this->_WSDL_URI."/wsdl",
'encoding' => 'UTF-8'));
$soap->setClass('\Application\Webservices\gpa');
$soap->handle();
}
?>
<?php
//gpa.php
namespace Application\webservices;
use MyClasses\Conn\Conn,
DoctrineModule\Authentication\Adapter\ObjectRepository,
Zend\Authentication\AuthenticationService;
class gpa{
public function autentica(string $login, string $senha){
$adapter = new ObjectRepository();
$auth = new AuthenticationService();
$adapter->setOptions(array(
'object_manager' => Conn::getConn(),
//my EntityManager
'identity_class' =>
'MyClasses\Entities\AclUsuario',
'identity_property' => 'login',
'credential_property' => 'senha'
)
);
$adapter->setIdentityValue($login);
$adapter->setCredentialValue(sha1($senha));
$resultado = $auth->authenticate($adapter);
if ($resultado->isValid()){
return array($resultado->getIdentity()->getId(),
$resultado->getIdentity()->getNome());
}else
return array(0=>"login invalido");
}
}
?>
Actual result:
--------------
An error occurred during execution; please try again later.
Informação adicional:
SoapFault
Arquivo:
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Soap/Client.php:1118
Mensagem:
SOAP-ERROR: Encoding: string 'adm \xe7...' is not a valid utf-8
string
Pilha de execução:
#0
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Soap/Client.php(1118):
SoapClient->__soapCall('autentica', Array, NULL, NULL, Array)
#1
/mnt/sda3/PROJETOS/WEB/GPA/module/Application/src/Application/Controller/WebserviceController.php(62):
Zend\Soap\Client->__call('autentica', Array)
#2
/mnt/sda3/PROJETOS/WEB/GPA/module/Application/src/Application/Controller/WebserviceController.php(62):
Zend\Soap\Client->autentica('jorgeley', '123')
#3
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83):
Application\Controller\WebserviceController->autenticaAction()
#4 [internal function]:
Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#5
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#6
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure))
#7
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(116):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure))
#8
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(113):
Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request),
Object(Zend\Http\PhpEnvironment\Response))
#9 [internal function]:
Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#10
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure))
#12
/mnt/sda3/PROJETOS/WEB/GPA/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /mnt/sda3/PROJETOS/WEB/GPA/public/index.php(17):
Zend\Mvc\Application->run()
#14 {main}
--
Edit bug report at https://bugs.php.net/bug.php?id=69515&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69515&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69515&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69515&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69515&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69515&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69515&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69515&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69515&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69515&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69515&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69515&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69515&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69515&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69515&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69515&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69515&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69515&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69515&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69515&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69515&r=mysqlcfg