Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Delphi para la web
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-11-2012
Alexis De la Cr Alexis De la Cr is offline
Miembro
 
Registrado: may 2006
Ubicación: Puebla
Posts: 124
Poder: 18
Alexis De la Cr Va por buen camino
Web Service timbrado CFDI

Estimados conpañeros del foro

como programador me han encargo crear un modulo de timbrado para factura electronica, sin embargo aunque he leido tutoriales de webservice y me he informado, los ejemplos que he encontrado son bastante sencillos y ya aplicados al web service del timbrador la verdad es que se me dificulta entenderle.

les anexo, la unidad que se utiliza para el webservice

Código Delphi [-]
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://201.155.181.40:59080/axis2/se...egradores?wsdl
//  >Import : http://201.155.181.40:59080/axis2/se...radores?wsdl:0
// Encoding : UTF-8
// Version  : 1.0
// (12/04/2012 06:31:38 p.m. - * $Rev: 5154 $)
// ************************************************************************ //

unit TimbradorIntegradores;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
  IS_OPTN = $0001;
  IS_UNBD = $0002;
  IS_NLBL = $0004;
  IS_UNQL = $0008;
  IS_ATTR = $0010;
  IS_TEXT = $0020;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"

  get                  = class;                 { "http://integradores.cfdi.mx.konesh.com"[!U][GblElm] }
  Exception            = class;                 { "http://integradores.cfdi.mx.konesh.com"[!U][GblCplx] }
  getResponse          = class;                 { "http://integradores.cfdi.mx.konesh.com"[!U][GblElm] }
  TimbradorIntegradoresException = class;       { "http://integradores.cfdi.mx.konesh.com"[!U][GblElm] }



  // ************************************************************************ //
  // XML       : get, global, 
  // Namespace : http://integradores.cfdi.mx.konesh.com
  // ************************************************************************ //
  get = class(TRemotable)
  private
    Fcad: WideString;
    Ftk: WideString;
    Fuser: WideString;
    Fpass: WideString;
    Fcuenta: WideString;
  published
    property cad:    WideString  Index (IS_OPTN or IS_NLBL) read Fcad write Fcad;
    property tk:     WideString  Index (IS_OPTN or IS_NLBL) read Ftk write Ftk;
    property user:   WideString  Index (IS_OPTN or IS_NLBL) read Fuser write Fuser;
    property pass:   WideString  Index (IS_OPTN or IS_NLBL) read Fpass write Fpass;
    property cuenta: WideString  Index (IS_OPTN or IS_NLBL) read Fcuenta write Fcuenta;
  end;



  // ************************************************************************ //
  // XML       : Exception, global, 
  // Namespace : http://integradores.cfdi.mx.konesh.com
  // ************************************************************************ //
  Exception = class(TRemotable)
  private
    FMessage_: WideString;
  published
    property Message_: WideString  Index (IS_OPTN or IS_NLBL) read FMessage_ write FMessage_;
  end;



  // ************************************************************************ //
  // XML       : getResponse, global, 
  // Namespace : http://integradores.cfdi.mx.konesh.com
  // ************************************************************************ //
  getResponse = class(TRemotable)
  private
    Freturn: WideString;
  published
    property return: WideString  Index (IS_OPTN or IS_NLBL) read Freturn write Freturn;
  end;



  // ************************************************************************ //
  // XML       : TimbradorIntegradoresException, global, 
  // Namespace : http://integradores.cfdi.mx.konesh.com
  // ************************************************************************ //
  TimbradorIntegradoresException = class(TRemotable)
  private
    FTimbradorIntegradoresException: Exception;
  public
    destructor Destroy; override;
  published
    property TimbradorIntegradoresException: Exception  Index (IS_OPTN or IS_NLBL) read FTimbradorIntegradoresException write FTimbradorIntegradoresException;
  end;



implementation
  uses SysUtils;

destructor TimbradorIntegradoresException.Destroy;
begin
  FreeAndNil(FTimbradorIntegradoresException);
  inherited Destroy;
end;

initialization
  RemClassRegistry.RegisterXSClass(get, 'http://integradores.cfdi.mx.konesh.com', 'get');
  RemClassRegistry.RegisterXSClass(Exception, 'http://integradores.cfdi.mx.konesh.com', 'Exception');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(Exception), 'Message_', 'Message');
  RemClassRegistry.RegisterXSClass(getResponse, 'http://integradores.cfdi.mx.konesh.com', 'getResponse');
  RemClassRegistry.RegisterXSClass(TimbradorIntegradoresException, 'http://integradores.cfdi.mx.konesh.com', 'TimbradorIntegradoresException');

end.


Espero no violar ninguna norma, pero como la aplico?

porque he encontrado ejemplos com este

Código PHP:
try {
        
$client = new SoapClient("http://testing.solucionfactible.com/ws/services/Timbrado?wsdl");
        
$params = array('usuario' => $usuario'password' => $password'cfdiBase64'=>$b64'zip'=>False);
        
$response $client->__soapCall('timbrarBase64', array('parameters' => $params));
} catch (
SoapFault $fault) {
         echo 
"SOAPFault: ".$fault->faultcode."-".$fault->faultstring."\n";} 
deduzco que hay que armar una llamada a una funcion en este caso get, con valores. aqui es donde ya no le hallo.

Gracias

Última edición por Casimiro Notevi fecha: 06-11-2012 a las 11:24:44.
Responder Con Cita
  #2  
Antiguo 08-11-2012
Avatar de AzidRain
[AzidRain] AzidRain is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Córdoba, Veracruz, México
Posts: 2.914
Poder: 21
AzidRain Va camino a la fama
El webservice que quieres usar es del proveedor "SuFacturacion", quien a su vez lo subcontrato al parecer con otro desarrollador. En teoría un timbrador por webservice debe ser tan simple como pasarle una "cadena original" y un "certificado" y nos devolverá el "sello digital correspondiente" que es lo que requerimos para nuestros desarrollos. Desgraciadamente en México casi ningún "timbrador" autorizado lo ha hecho tan sencillo a pesar de que cobran por cada timbrado, salvo Contpaq que si bien no cobra, te cobra por comprarles su SDK.

Además de ello, muchos timbradores registrados o proveedores autorizados de CFDI por el SAT a su vez redistribuyen con terceros quienes son los que al final dan la cara al usuario como me imagio que es tu caso. "solucionfactible.com" es un simple revendedor de "SuFacturacion". En el codigo que pusiste de ejemplo se ve que en efecto solo tienes que llamar al servicio y los resultados se guardan en la variable $result.

No indicas si lo que quieres hacer es "timbrar" los CFDI o solo enviarlos a un proveedor para que los timbre
__________________
AKA "El animalito" ||Cordobés a mucha honra||
Responder Con Cita
  #3  
Antiguo 08-11-2012
edorantes edorantes is offline
Miembro
NULL
 
Registrado: oct 2012
Posts: 14
Poder: 0
edorantes Va por buen camino
Hola yo estoy case en lo mismo tengo que conectarme por medio de webservice a un pac.
La conexion ya la he hecho por asi decirlo won el wsdl importer mi problema es como implementar las funciones que se me han creado estoy en cero
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
CFDI-Facturacion electronica Mexico JXJ Varios 27 09-05-2011 20:15:12
Web Service CARSOFT_AR Internet 1 05-03-2007 08:03:02
Web Service madmai Internet 3 06-12-2006 21:01:45
Web Service CARSOFT_AR Internet 4 31-08-2006 17:34:05
Service y Application Service Ezecool Varios 0 30-09-2003 18:48:30


La franja horaria es GMT +2. Ahora son las 15:38:24.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi