Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Henrique Jorge

Conexão Web Service

Recommended Posts

Bom dia!!

 

Estou tentando gerar conexão web service em php para .net e https .

 

Código abaixo:

 

<?php 

$client = new SoapClient("https://seguro.tjrj.jus.br/satiexternows/satiexterno.asmx?WSDL",array("trace" => 1, "exceptions" => 0)); 

$functions = $client->__getFunctions(); 
print_r($functions); 

echo('<br>-----------------------------<br>'); 

$types = $client->__getTypes(); 
print_r($types); 

echo('<br>-----------------------------<br>'); 

$parameters = array( 
      'pLogin'=>'TJ_00824649796', 
      'pSenha'=>'gosti7', 
      'pCodOrgao'=>2847 
      ); 
$response = $client->LogarSistema($parameters); 
print_r($response); 

/* 
if (is_soap_fault($response)) 
  { 
    trigger_error("SOAP Fault: (faultcode: {$response->faultcode}, 
                   faultstring: {$response->faultstring})", E_ERROR); 
  } 
  else 
  { 
    echo "Resultado Encontrado : <br><br>"; 
    print_r($response); 
  } 
*/ 

print "<br><br><pre>\n"; 
print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n"; 
print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n"; 
print "</pre>"; 
?> 

 

Sendo que ao executar não está gerando conexão com https e sim http ,como destacado abaixo.

 

Request :

SoapFault Object ( [message:protected] => Could not connect to host [string:private] => [code:protected] => 0 [file:protected] => /home/storage/5/d2/ad/parvaim/public_html/cliente/paraty/clienteWSTJPHP5_3.php [line:protected] => 18 [trace:private] => Array ( [0] => Array ( [function] => __doRequest [class] => SoapClient [type] => -> [args] => Array ( [0] => TJ_00824649796gosti72847 [1] => http://seguro.tjrj.jus.br/satiexternows/satiexterno.asmx [2] => http://tempuri.org/LogarSistema [3] => 1 [4] => 0 ) ) [1] => Array ( [file] => /home/storage/5/d2/ad/parvaim/public_html/cliente/paraty/clienteWSTJPHP5_3.php [line] => 18 [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => LogarSistema [1] => Array ( [0] => Array ( [pLogin] => TJ_00824649796 [pSenha] => gosti7 [pCodOrgao] => 2847 ) ) ) ) [2] => Array ( [file] => /home/storage/5/d2/ad/parvaim/public_html/cliente/paraty/clienteWSTJPHP5_3.php [line] => 18 [function] => LogarSistema [class] => SoapClient [type] => -> [args] => Array ( [0] => Array ( [pLogin] => TJ_00824649796 [pSenha] => gosti7 [pCodOrgao] => 2847 ) ) ) ) [faultstring] => Could not connect to host [faultcode] => HTTP )

 

 

 

Por gentileza como poderia resolver este problema?

É necessário configurar o apache para https?

E como fazer essa configuração ??

 

 

Desde já obrigado,

JH

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.