Application / get_result_async
ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
#import <CkoXml.h>
#import <NSString.h>
#import <CkoHttp.h>
#import <CkoHttpResponse.h>
CkoXml *xml = [[CkoXml alloc] init];
xml.Tag = @"soapenv:Envelope";
[xml AddAttribute: @"xmlns:soapenv" value: @"http://schemas.xmlsoap.org/soap/envelope/"];
[xml AddAttribute: @"xmlns:sta" value: @"http://facturacion.finkok.com/stamp"];
[xml UpdateChildContent: @"soapenv:Header" value: @""];
[xml UpdateChildContent: @"soapenv:Body|sta:get_result_async|sta:id" value: @"string"];
[xml UpdateChildContent: @"soapenv:Body|sta:get_result_async|sta:username" value: @"string"];
[xml UpdateChildContent: @"soapenv:Body|sta:get_result_async|sta:password" value: @"string"];
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
xml.EmitXmlDecl = NO;
NSString *soapRequestBody = [xml GetXml];
NSString *endpoint = @"https://demo-facturacion.finkok.com/servicios/soap/stamp";
NSString *soapAction = @"get_result_async";
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
NSString *contentType = @"text/xml";
CkoHttp *http = [[CkoHttp alloc] init];
[http ClearHeaders];
[http SetRequestHeader: @"Content-Type" value: contentType];
[http SetRequestHeader: @"SOAPAction" value: soapAction];
CkoHttpResponse *resp = [http PostXml: endpoint xmlDoc: soapRequestBody charset: @"utf-8"];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",http.LastErrorText);
NSLog(@"%@",@"Failed to send SOAP request.");
return;
}
// Get the XML response body.
CkoXml *responseXml = [[CkoXml alloc] init];
[resp GetBodyXml: responseXml];
int statusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"response status code: ",statusCode);
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
NSLog(@"%@",[responseXml GetXml]);
return;
}
NSLog(@"%@",[responseXml GetXml]);
// Parse the successful SOAP response XML.
// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).
NSString *UUID = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:UUID"];
NSString *RfcProvCertif = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:RfcProvCertif"];
NSString *NoCertificadoSAT = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:NoCertificadoSAT"];
NSString *CodEstatus = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:CodEstatus"];
NSString *faultstring = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:faultstring"];
NSString *faultcode = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:faultcode"];
NSString *file = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:file"];
NSString *SatSeal = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:SatSeal"];
NSString *IdIncidencia = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:IdIncidencia"];
NSString *RfcEmisor = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:RfcEmisor"];
NSString *Uuid = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:Uuid"];
NSString *CodigoError = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:CodigoError"];
NSString *WorkProcessId = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:WorkProcessId"];
NSString *MensajeIncidencia = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:MensajeIncidencia"];
NSString *ExtraInfo = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:ExtraInfo"];
NSString *NoCertificadoPac = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:NoCertificadoPac"];
NSString *FechaRegistro = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:Incidencias|*:Incidencia|*:FechaRegistro"];
NSString *FechaTimbrado = [responseXml GetChildContent: @"*:Body|*:get_result_asyncResponse|*:get_result_asyncResult|*:FechaTimbrado"];
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sta="http://facturacion.finkok.com/stamp">
<soapenv:Header/>
<soapenv:Body>
<sta:get_result_async>
<sta:id>string</sta:id>
<sta:username>string</sta:username>
<sta:password>string</sta:password>
</sta:get_result_async>
</soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s1="https://facturacion.finkok.com/servicios/async" xmlns:sta="http://facturacion.finkok.com/stamp" xmlns:s0="apps.services.soap.core.views">
<soapenv:Header/>
<soapenv:Body>
<sta:get_result_asyncResponse>
<sta:get_result_asyncResult>
<s1:UUID>string</s1:UUID>
<s1:RfcProvCertif>string</s1:RfcProvCertif>
<s1:NoCertificadoSAT>string</s1:NoCertificadoSAT>
<s1:CodEstatus>string</s1:CodEstatus>
<s1:faultstring>string</s1:faultstring>
<s1:faultcode>string</s1:faultcode>
<s1:file>BqozVXeZZg==</s1:file>
<s1:SatSeal>string</s1:SatSeal>
<s1:Incidencias>
<s0:Incidencia>
<s0:IdIncidencia>string</s0:IdIncidencia>
<s0:RfcEmisor>string</s0:RfcEmisor>
<s0:Uuid>string</s0:Uuid>
<s0:CodigoError>string</s0:CodigoError>
<s0:WorkProcessId>string</s0:WorkProcessId>
<s0:MensajeIncidencia>string</s0:MensajeIncidencia>
<s0:ExtraInfo>string</s0:ExtraInfo>
<s0:NoCertificadoPac>string</s0:NoCertificadoPac>
<s0:FechaRegistro>string</s0:FechaRegistro>
</s0:Incidencia>
</s1:Incidencias>
<s1:FechaTimbrado>dateTime</s1:FechaTimbrado>
</sta:get_result_asyncResult>
</sta:get_result_asyncResponse>
</soapenv:Body>
</soapenv:Envelope>