Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-11-2008
marilinspi marilinspi is offline
Miembro
 
Registrado: ene 2007
Posts: 136
Poder: 18
marilinspi Va por buen camino
Enviar TRA al WSAA

hola a todos estoy con el tema de la factura electronica... ya consegui el certificado x509 y crear el TRA, ahora en lo que necesito ayuda es en como enviarlo al WSAA, tengo un ejemplo en PHP pero no logro reproducirlo en Delphi talvez alguien de ustedes conozca los dos lenguajes y me pueda ayudar o sino alguien que ya haya pasado por esta situacion y lo resolvio que me de una mano. aca va el codigo en PHP

Cita:
Input:
WSDL, CERT, PRIVATEKEY, PASSPHRASE, SERVICE, WSAAURL
Check below for its definitions
Output:
TA.xml: the authorization ticket as granted by WSAA.
==============================================================================
define ("WSDL", "wsaa.wsdl"); # The WSDL corresponding to WSAA
define ("CERT", "ghf.crt"); # The X.509 obtained from Seg. Inf.
define ("PRIVATEKEY", "ghf.key"); # The private key correspoding to CERT
define ("PASSPHRASE", "xxxxxxx"); # The passphrase (if any) to sign
SERVICE: The WS service name you are asking a TA for
define ("SERVICE", "wsfe");
WSAAURL: the URL to access WSAA, check for http or https and wsaa or wsaahomo
define ("WSAAURL", "https://wsaa.afip.gov.ar/ws/services/LoginCms");
define ("WSAAURL", "https://wsaahomo.afip.gov.ar/ws/services/LoginCms");



function SignTRA()
{
$STATUS=openssl_pkcs7_sign("TRA.xml", "TRA.tmp", "file://".CERT,
array("<A href="file://".PRIVATEKEY/">file://".PRIVATEKEY, PASSPHRASE),
array(),
!PKCS7_DETACHED
);
if (!$STATUS) {exit("ERROR generating PKCS#7 signature\n");}
$inf=fopen("TRA.tmp", "r");
$i=0;
$CMS="";
while (!feof($inf))
{
$buffer=fgets($inf);
if ( $i++ >= 4 ) {$CMS.=$buffer;}
}
fclose($inf);
unlink("TRA.xml");
unlink("TRA.tmp");
return $CMS;
}
desde ya muchas gracias.

Última edición por marilinspi fecha: 28-11-2008 a las 14:13:19.
Responder Con Cita
 



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
Enviar SMS panque Internet 11 21-05-2010 09:43:00
enviar mail mjjj Varios 4 29-04-2008 03:50:17
Enviar mensaje Ignacio Varios 6 05-03-2004 09:38:07
enviar fax camambrini Varios 1 03-01-2004 16:00:55
Enviar fax AbcXxx Varios 2 09-09-2003 21:14:32


La franja horaria es GMT +2. Ahora son las 08:14:00.


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