Bug #69515 [Opn->Nab]: Error on Zend SOAP (sorry if duplicated)

From: Date: Thu, 23 Apr 2015 18:12:30 +0000
Subject: Bug #69515 [Opn->Nab]: Error on Zend SOAP (sorry if duplicated)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192302@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69515&edit=1

 ID:                 69515
 Updated by:         cmb@php.net
 Reported by:        jorgeley at gmail dot com
 Summary:            Error on Zend SOAP (sorry if duplicated)
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            SOAP related
 Operating System:   Linux
 PHP Version:        5.5Git-2015-04-23 (snap)
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Quick hint: fix the service's output.


Previous Comments:
------------------------------------------------------------------------
[2015-04-23 16:40:50] jorgeley at gmail dot com

I dont know if this is the correct way to solve, but i did this:
return array($resultado->getIdentity()->getId(),
mb_convert_encoding($resultado->getIdentity()->getNome(),'UTF-8'));

It's working.
Any Suggestions???

------------------------------------------------------------------------
[2015-04-23 14:54:08] jorgeley at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=69515&edit=1


Thread (3 messages)

« previous php.bugs (#192302) next »