Ver Mensaje Individual
  #183  
Antiguo 16-02-2017
Francisco1973 Francisco1973 is offline
Miembro
 
Registrado: abr 2008
Posts: 10
Reputación: 0
Francisco1973 Va por buen camino
Hola, como envio:

defWSDL:='https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroFactEmitidas.wsdl';
defSvc:='siiService';
defPrt:='SuministroFactEmitidasPruebas';

HTTPRIO1.WSDLLocation:=defWSDL;
HTTPRIO1.Service:=defSvc;
HTTPRIO1.Port:=defPrt;

CrearSumLRFacturasEmitidasTest(Peticion);
Resultado:=GetsiiSOAP(true,'',HTTPRIO1).SuministroLRFacturasEmitidas(Peticion);

Y el certificado: (es necesario tener registrado capicom.dll y la unidad CAPICOM_TLB

procedure TForm1.HTTPRIO1HTTPWebNode1BeforePost(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:=NombreCertificado; { subject del certificado instalado: Nombre de la empresa }

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 ); { Buscar certificado por nombre }
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( 'Internet SSL certificate. Something went wrong' );
end;
end;
end;
Responder Con Cita