Cita:
Empezado por joefrommalaka
|
Hola. Este problema ya esta resuelto en enlaces anteriores, es la forma de asignar el certificado. Se soluciono con las capicom. Yo he llegado a enviar un bloque de 10000 facturas para ver si funcionaba y todo correcto.
Te pongo el codigo pero revisa los post anteriores. En el evento OnbeforePost del objeto HttpTrio tienes que poner lo siguiente
Código Delphi
[-] procedure TFSIIConsultar.SoapeadorHTTPWebNode1BeforePost(
const HTTPReqResp: THTTPReqResp; Data: Pointer);
var
Store : IStore;
Certs : ICertificates;
Cert : ICertificate2;
CertContext : ICertContext;
PCertContext : PCCERT_CONTEXT;
V : OleVariant;
const
INTERNET_OPTION_CLIENT_CERT_CONTEXT = 84;
begin
V := Certificado;
Store := CoStore.Create;
Store.Open(CAPICOM_CURRENT_USER_STORE, 'MY',CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED );
Certs := Store.Certificates.Find(CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME,V,False );
if Certs.Count > 0 then
begin
Cert:=IInterface(Certs.Item[1]) as ICertificate2;
CertContext:=Cert as ICertContext;
CertContext.Get_CertContext(Integer(PCertContext));
if InternetSetOption(Data,INTERNET_OPTION_CLIENT_CERT_CONTEXT,PCertContext,Sizeof(CERT_CONTEXT)) = False then
begin
showmessage('ERROR');
end;
end
else
begin
showmessage('ERROR');
end;
end;