Webservice SAT CFDI 3.3
Webservice SAT CFDI 3.3
Webservice SAT CFDI 3.3
│ │
1
Tabla de Contenido
1 Descripción .......................................................................................................... 3
2 Contrato ............................................................................................................... 4
│
│ │
2
1. Descripción
El Servicio de consulta de CFDI´s se diseñó para permitir la validación accediendo a un servicio
publicado en la página del SAT, el servicio pretende proveer una alternativa de consulta que
requiera verificar el estado de un comprobante en las Bases de Datos del SAT.
│
│ │
3
2. Contrato
URL: https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc
WSDL ConsultaCFDIService.svc?wsdl
│
│ │
4
service ConsultaCFDIService
diagra
m
ports
BasicHttpBinding_IConsultaCFDIService
binding tns:BasicHttpBinding_IConsultaCFDIService
extensibility <soap:address
location="https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDISer
vice.svc"/>
source <wsdl:service name="ConsultaCFDIService">
<wsdl:port name="BasicHttpBinding_IConsultaCFDIService"
binding="tns:BasicHttpBinding_IConsultaCFDIService">
<soap:address
location="https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc"/>
</wsdl:port>
</wsdl:service>
binding BasicHttpBinding_IConsultaCFDIService
diagram
type tns:IConsultaCFDIService
│
│ │
5
used by Port BasicHttpBinding_IConsultaCFDIService in Service ConsultaCFDIService
porttype IConsultaCFDIService
diagram
operations Consulta
input tns:IConsultaCFDIService_Consulta_InputMessage
output tns:IConsultaCFDIService_Consulta_OutputMessage
used by binding BasicHttpBinding_IConsultaCFDIService
message IConsultaCFDIService_Consulta_InputMessage
parts parameters
element tns:Consulta
│
│ │
6
source <wsdl:message name="IConsultaCFDIService_Consulta_InputMessage">
<wsdl:part name="parameters" element="tns:Consulta"/>
</wsdl:message>
message IConsultaCFDIService_Consulta_OutputMessage
parts parameters
element tns:ConsultaResponse
element Consulta
diagram
namespace http://tempuri.org/
children tns:expresionImpresa
element ConsultaResponse
diagram
namespace http://tempuri.org/
children tns:ConsultaResult
│
│ │
7
source <xsd:element name="ConsultaResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ConsultaResult" type="q1:Acuse" nillable="true"
minOccurs="0"/> </xsd:sequence>
</xsd:complexType>
</xsd:element>
CODIGO
│
│ │
8
=xsd2" namespace="http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="IConsultaCFDIService_Consulta_InputMessage">
<wsdl:part name="parameters" element="tns:Consulta" />
</wsdl:message>
<wsdl:message name="IConsultaCFDIService_Consulta_OutputMessage">
<wsdl:part name="parameters" element="tns:ConsultaResponse" /> </wsdl:message>
<wsdl:portType name="IConsultaCFDIService">
<wsdl:operation name="Consulta">
<wsdl:input wsaw:Action="http://tempuri.org/IConsultaCFDIService/Consulta"
message="tns:IConsultaCFDIService_Consulta_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IConsultaCFDIService/ConsultaResponse"
message="tns:IConsultaCFDIService_Consulta_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IConsultaCFDIService" type="tns:IConsultaCFDIService">
<wsp:PolicyReference URI="#BasicHttpBinding_IConsultaCFDIService_policy" />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Consulta">
<soap:operation soapAction="http://tempuri.org/IConsultaCFDIService/Consulta" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConsultaCFDIService">
<wsdl:port name="BasicHttpBinding_IConsultaCFDIService" binding="tns:BasicHttpBinding_IConsultaCFDIService">
<soap:address location="https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
3. Mensajes de Respuesta
Los mensajes de respuesta que arroja el servicio de consulta de CFDI´s incluyen la descripción del
resultado de la operación que corresponden a la siguiente clasificación:
Mensajes de Rechazo.
N 601: La expresión impresa proporcionada no es válida.
│
│ │
9
Este código de respuesta se presentará cuando el UUID del comprobante no se encuentre en la
Base de Datos del SAT.
Mensajes de Aceptación.
S Comprobante obtenido satisfactoriamente.
4. Ejemplo de Implementación
namespace Sat.Cfdi.Negocio.ConsultaCfdi.Servicio
{
using System.Runtime.Serialization;
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="Acuse",
Namespace="http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio")]
[System.SerializableAttribute()]
public partial class Acuse : object, System.Runtime.Serialization.IExtensibleDataObject,
System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string CodigoEstatusField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string EsCancelableField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string EstadoField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string EstatusCancelacionField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string CodigoEstatus {
│
│ │
10
get {
return this.CodigoEstatusField;
}
set {
if ((object.ReferenceEquals(this.CodigoEstatusField, value) != true)) {
this.CodigoEstatusField = value;
this.RaisePropertyChanged("CodigoEstatus");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string EsCancelable {
get {
return this.EsCancelableField;
}
set {
if ((object.ReferenceEquals(this.EsCancelableField, value) != true)) {
this.EsCancelableField = value;
this.RaisePropertyChanged("EsCancelable");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Estado {
get {
return this.EstadoField;
}
set {
if ((object.ReferenceEquals(this.EstadoField, value) != true)) {
this.EstadoField = value;
this.RaisePropertyChanged("Estado");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string EstatusCancelacion {
get {
return this.EstatusCancelacionField;
}
set {
if ((object.ReferenceEquals(this.EstatusCancelacionField, value) != true)) {
this.EstatusCancelacionField = value;
this.RaisePropertyChanged("EstatusCancelacion");
}
}
}
│
│ │
11
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="ConsultaCFDIService.IConsultaCFDIService")
]
public interface IConsultaCFDIService {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConsultaCFDIService/Consulta",
ReplyAction="http://tempuri.org/IConsultaCFDIService/ConsultaResponse")]
QRConsola.ConsultaCFDIService.Acuse Consulta(string expresionImpresa);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConsultaCFDIService/Consulta",
ReplyAction="http://tempuri.org/IConsultaCFDIService/ConsultaResponse")]
System.Threading.Tasks.Task<QRConsola.ConsultaCFDIService.Acuse> ConsultaAsync(string
expresionImpresa);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface IConsultaCFDIServiceChannel : QRConsola.ConsultaCFDIService.IConsultaCFDIService,
System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ConsultaCFDIServiceClient :
System.ServiceModel.ClientBase<QRConsola.ConsultaCFDIService.IConsultaCFDIService>,
QRConsola.ConsultaCFDIService.IConsultaCFDIService {
public ConsultaCFDIServiceClient() {
}
│
│ │
12
public ConsultaCFDIServiceClient(System.ServiceModel.Channels.Binding binding,
System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
│
│ │
13
5. Capacidad de respuesta
El servicio de Consulta de CFDI´s tiene la capacidad de atender hasta 2 millones de consultas por
hr., debido a que estas consultas acceden las Bases de Datos transaccionales del SAT se solicita no
aumentar la cantidad de consultas por hora para evitar impactos en la respuesta del servicio.
│
│ │
14