I have a class called Cliente.php
which makes the connection to the web service and I have another call Requisição.php
that generate the XML request and sends it to Cliente.php
.
The problem is that the response I get from web service can only show with print_r
in class Cliente.php
and I can not show in class Requisição.php
, even putting Cliente
with return
.
WHAT SHOWS IS THE NAME IS: Client Object ()
class Cliente {
public function __construct($requisicao) {
//Endereço e conexão com o web service
$client = new SoapClient("http://192.168.1.104:8082/wsdl/FChamada");
//Requisição ao web service
$obj = $client->Requisicao($requisicao);
//Retorno(Resposta) do web service
$xml = simplexml_load_string($obj);
//Retorna o a resposta do web service
return $xml;
}
}
class Requisicao {
/***********************************************************************
********************* REQUISÃO ****************************************
**********************************************************************/
public function query() {
$req = new Requisicao_XML();
//Gerando o xml requisição
$requisicao = $req->toXML();
//Envia o xml requisição para a classe Cliente e recebe o xml resposta
$xml = new Cliente($requisicao);
//Deveria mostrar o xml resposta
print_r($xml)
}
}