A prefeitura oferece um ótimo suporte (sarcasmo) a webservice fornecida, e graças a isso estou perdido a muito tempo no que deveria ser um negócio muito simples.
http://isscuritiba.curitiba.pr.gov.br/
Com o código abaixo eu faço login no webservice do ISS de curitiba, consigo enviar a requisição xml com sucesso e receber o retorno do webservice, porém, não consigo identificar no servidor/documentação quais são os campos obrigatórios pra trazer dados, e nem quais são os formatos dos campos, a minha resposta é que os dados enviados sempre estão inválidos.
<?php
$xml_data = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ConsultarNfse xmlns="http://www.e-governeapps2.com.br/">
<ConsultarNfseEnvio>
<Prestador>
<Cnpj>string</Cnpj>
<InscricaoMunicipal>string</InscricaoMunicipal>
</Prestador>
</ConsultarNfseEnvio>
</ConsultarNfse>
</soap:Body>
</soap:Envelope>';
$url = "https://pilotoisscuritiba.curitiba.pr.gov.br/nfse_ws/NfseWs.asmx?WSDL";
$headers = array(
"POST /nfse_ws/nfsews.asmx HTTP/1.1",
"Host: pilotoisscuritiba.curitiba.pr.gov.br",
"Content-Type: text/xml; charset=utf-8",
"SOAPAction: \"http://www.e-governeapps2.com.br/ConsultarNfse\"",
"Content-length: " . strlen($xml_data)
);
$xml = $xml_data;
$ch = curl_init();
$soapUser = "username"; // username
$soapPassword = "123456"; // password
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . '\Pre_ISS_Cert.pem');
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSH_PRIVATE_KEYFILE, getcwd() . '\Pref_ISS_Cert.pfx');
curl_setopt($ch, CURLOPT_SSLCERT, getcwd() . '\Pre_ISS_Cert.pem');
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "easy2017");
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$ch_result = curl_exec($ch);
print_r($ch_result);
curl_close($ch);
?>
Alguma ideia do que fazer nessa situação sabendo que não adianta ligar pro lugar que fornece o serviço?