NotaControl ConsultaSituacaoLoteRPS retornando erro L023

Cidade: Anápolis/GO - 5201108
Provedor: Nota Control

Situação: ao enviar o RPS para processamento, a consulta do Lote através do método ConsultaSituacaoLoteRPS sempre retorna Erro L023.

Por algum motivo desconhecido esse método é sensivel ao conteúdo enviado.
Usando o Service criado pelo .NET, o método é enviado em um padrão diferente do esperado.

Analisando o aplicativo Converge.NET a chamada SOAP é a seguinte:

POST /webserviceabrasf/Anapolis/servicos.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.8806)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.issnetonline.com.br/webservice/nfd/ConsultaSituacaoLoteRPS"
Host: www.issnetonline.com.br
Content-Length: 859
Expect: 100-continue
Connection: close

<?xml version="1.0" encoding="utf-8"?><soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConsultaSituacaoLoteRPS xmlns="http://www.issnetonline.com.br/webservice/nfd">
<xml>
&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;ConsultarSituacaoLoteRpsEnvio xmlns="http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_situacao_lote_rps_envio.xsd"&gt;&lt;Prestador&gt;&lt;tc:CpfCnpj xmlns:tc="http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_complexos.xsd"&gt;&lt;tc:Cnpj&gt;01063648000250&lt;/tc:Cnpj&gt;&lt;/tc:CpfCnpj&gt;&lt;/Prestador&gt;&lt;Protocolo&gt;100ec248-1065-4776-9fe7-59dccbf4fc9b&lt;/Protocolo&gt;&lt;/ConsultarSituacaoLoteRpsEnvio&gt;
</xml>
</ConsultaSituacaoLoteRPS>
</soap:Body>
</soap:Envelope>

Copiando o exemplo acima e enviando manualmente, funciona como esperado.
Já pelo objeto Service do .NET, não.
Acredito que seja por causa do Header: 100-continue.

Bom dia!

Estou com o mesmo problema, ja fiz o 100-Continue e mesmo assim nao funcioa, vc conseguiu enviar de alguma forma usando o Service do .Net?

Eu consegui pelo .NET

Como falei, usando o services do .NET não funcionou.
Tive que implementar minha própria chamada.

Ficou assim:

        public string ConsultarSituacaoLoteRPS(string CNPJ, string IM, string Protocolo)
        {
            String NfseDados = String.Format(
                "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" +
                "&lt;ConsultarSituacaoLoteRpsEnvio xmlns=\"http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_situacao_lote_rps_envio.xsd\"&gt;" +
                "&lt;Prestador&gt;" +
                "&lt;tc:CpfCnpj xmlns:tc=\"http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_complexos.xsd\"&gt;" +
                "&lt;tc:Cnpj&gt;{0}&lt;/tc:Cnpj&gt;" +
                "&lt;/tc:CpfCnpj&gt;" +
                "&lt;/Prestador&gt;" +
                "&lt;Protocolo&gt;{1}&lt;/Protocolo&gt;" +
                "&lt;/ConsultarSituacaoLoteRpsEnvio&gt;", CNPJ, Protocolo);

            String s = String.Format(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
                "<soap:Body>" +
                "<ConsultaSituacaoLoteRPS xmlns =\"http://www.issnetonline.com.br/webservice/nfd\">" +
                "<xml>{0}</xml>" +
                "</ConsultaSituacaoLoteRPS>" +
                "</soap:Body>" +
                "</soap:Envelope>",
                NfseDados);

            File.WriteAllText(cFileName.Replace(".xml", ".soap.xml"), s);

            return this.SendRequest(s, "http://www.issnetonline.com.br/webservice/nfd/ConsultaSituacaoLoteRPS");
        }

        public string SendRequest(string data, string action)
        {
            try
            {
                WebRequestHandler handler = new WebRequestHandler();
                if (this.Certificado != null)
                    handler.ClientCertificates.Add(this.Certificado);
                HttpClient client = new HttpClient(handler);
                client.DefaultRequestHeaders.ExpectContinue = false;
                client.DefaultRequestHeaders.Add("Accept", "*/*");
                //client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/soap+xml"));
                //client.DefaultRequestHeaders.Add("SOAPAction", action);
                client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.8806)");
                client.DefaultRequestHeaders.TransferEncodingChunked = null;

                StringContent queryString = new StringContent(data, Encoding.UTF8, "text/xml");
                HttpResponseMessage response = client.PostAsync(new Uri(this.Url), queryString).Result;
                String responseValue = string.Empty;
                Stream responseStream = null;


                if (response != null)
                {
                    Task task = response.Content.ReadAsStreamAsync().ContinueWith(t =>
                    {
                        responseStream = t.Result;
                    });
                    task.Wait();

                    string encoding = String.Join(",", response.Content.Headers.ContentEncoding);

                    if (response.Content.Headers.ContentEncoding.Contains("gzip"))
                        responseStream = new GZipStream(responseStream, CompressionMode.Decompress);
                    else if (response.Content.Headers.ContentEncoding.Contains("deflate"))
                        responseStream = new DeflateStream(responseStream, CompressionMode.Decompress);

                    using (StreamReader streamReader = new StreamReader(responseStream))
                    {
                        responseValue = streamReader.ReadToEnd();
                    }

                }

                return responseValue;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Eu usei os seguintes imports:

using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.Xml;