I'm trying to consume the NFE download service on the farm:
Specification
Using .Net, C #, MVC
But I have gotten the following error:
The remote server returned an error: (500) Internal Server Error.
The message I have sent is:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<nfeDistDFeInteresse>
<nfeDadosMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
<distDFeInt versao="1.00" xmlns="http://www.portalfiscal.inf.br/nfe">
<tpAmb>1</tpAmb>
<cUFAutor>31</cUFAutor>
<CNPJ>[CNPJ DA EMPRESA]</CNPJ>
<distNSU>
<ultNSU>000000000000000</ultNSU>
</distNSU>
</distDFeInt>
</nfeDadosMsg>
</nfeDistDFeInteresse>
</soap:Body>
</soap:Envelope>
REMOVI all spaces, I consume other services successfully
request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = byteData.Length;
The certificate I'm sure is correct too.
I emphasize that I can consume other services.
Service WSDL
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe">
<s:element name="nfeDistDFeInteresse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="nfeDadosMsg">
<s:complexType mixed="true">
<s:sequence>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="nfeDistDFeInteresseResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="nfeDistDFeInteresseResult">
<s:complexType mixed="true">
<s:sequence>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="nfeDistDFeInteresseSoapIn">
<wsdl:part name="parameters" element="tns:nfeDistDFeInteresse"/>
</wsdl:message>
<wsdl:message name="nfeDistDFeInteresseSoapOut">
<wsdl:part name="parameters" element="tns:nfeDistDFeInteresseResponse"/>
</wsdl:message>
<wsdl:portType name="NFeDistribuicaoDFeSoap">
<wsdl:operation name="nfeDistDFeInteresse">
<wsdl:input message="tns:nfeDistDFeInteresseSoapIn"/>
<wsdl:output message="tns:nfeDistDFeInteresseSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NFeDistribuicaoDFeSoap" type="tns:NFeDistribuicaoDFeSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="nfeDistDFeInteresse">
<soap:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe/nfeDistDFeInteresse" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NFeDistribuicaoDFeSoap12" type="tns:NFeDistribuicaoDFeSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="nfeDistDFeInteresse">
<soap12:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe/nfeDistDFeInteresse" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NFeDistribuicaoDFe">
<wsdl:port name="NFeDistribuicaoDFeSoap" binding="tns:NFeDistribuicaoDFeSoap">
<soap:address location="https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx"/>
</wsdl:port>
<wsdl:port name="NFeDistribuicaoDFeSoap12" binding="tns:NFeDistribuicaoDFeSoap12">
<soap12:address location="https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>