Webservice PHP WSDL XML

Asked

Viewed 435 times

1

Hello, I’m developing a PHP system where I manage my court cases. I would like to receive the process movements automatically, so I saw that there is a Webservice to facilitate this functionality. But I know absolutely nothing about Webservice. I can do the Webservice Query by Soapui but I don’t know how to do it by PHP. Can someone help me? I tried to do it with Nusoap, but I’ve seen other places he’s no longer recommended. This is the available WSDL address: https://pje.tjba.jus.br/pje-web/intercomunicacao?wsdl I tried something with Soapclient but I couldn’t either. I’ll send the code snippet:

$client = new SoapClient('https://pje.tjba.jus.br/pje-web/intercomunicacao?wsdl', array("trace" => 1,"exceptions"=>0));


$function = 'consultarProcesso';


$arguments= array('consultarProcesso' => array(
                    'idConsultante'   => $idConsultante,
                    'senhaConsultante'      => $senhaConsultante,
                    'numeroProcesso'        => $numeroProcesso
            ));

$result = $client->__soapCall($function, $arguments);


echo 'Response: ';
print_r($result);

//O código abaixo é para exibir o XML enviado
echo "<br><br>REQUEST<br><br>:\n" . htmlentities($client->__getLastRequest()). "\n";

Below what I get in the browser

Response: SoapFault Object ( [message:protected] => looks like we got no XML document [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\Users\Fernando Issler\Dropbox\xampp\htdocs\nusoap\index.php [line:protected] => 14 [trace:Exception:private] => Array ( [0] => Array ( [file] => C:\Users\Fernando Issler\Dropbox\xampp\htdocs\nusoap\index.php [line] => 14 [function] => __soapCall [class] => SoapClient [type] => -> [args] => Array ( [0] => consultarProcesso [1] => Array ( [tipoConsultarProcesso] => Array ( [idConsultante] => 02482451558 [senhaConsultante] => Fis2047a [numeroProcesso] => 8000597-16.2019.8.05.0141 ) ) ) ) ) [previous:Exception:private] => [faultstring] => looks like we got no XML document [faultcode] => Client [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/ ) 

REQUEST

: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.cnj.jus.br/tipos-servico-intercomunicacao-2.2.2" xmlns:ns2="http://www.cnj.jus.br/servico-intercomunicacao-2.2.2/"><SOAP-ENV:Body><ns2:consultarProcesso><ns1:idConsultante>02482451558</ns1:idConsultante><ns1:senhaConsultante>Fis2047a</ns1:senhaConsultante><ns1:numeroProcesso>8000597-16.2019.8.05.0141</ns1:numeroProcesso></ns2:consultarProcesso></SOAP-ENV:Body></SOAP-ENV:Envelope>

Strangeness I noticed that there are two points (:) before XML. I don’t know if this has anything to do.

Thanks in advance.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.