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 Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 19-03-2015
frankizzio frankizzio is offline
Miembro
NULL
 
Registrado: abr 2013
Posts: 10
Poder: 0
frankizzio Va por buen camino
Consumir servicio con WDSL - autentificación WS-Security

Lo resolví utilizando esta función

Código Delphi [-]
function GetbillService(UseWSDL: Boolean; Addr: string;var HTTPRIO: THTTPRIO): billService;
 const
  defWSDL = 'htt ps://ww w. sunat. gob. pe:443/ol-ti-itcpgem-beta/billService?wsdl';
  defURL  = 'htt ps://w ww.s unat. gob. pe:443/ol-ti-itcpgem-beta/billService';
  defSvc  = 'billService';
  defPrt  = 'BillServicePort';
 var
  RIO: THTTPRIO;
 begin
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as billService);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;

 end;

Y utilizandolo en la acción del botón

Código Delphi [-]
    tBillServ:=GetbillService(True,'',HTTPRIO1);

Establezco la conexión pero el WSDL Importer no generó la cabecera de seguridad UsernameToken, ahora un nuevo dilema, buscando en internet encuentro info sobre como implementar una unit llamada WSSE.pas pero no me queda claro su función
Cómo puedo configurar la cabecera para que aparezca de la siguiente manera

Código:
<soapenv:Envelope xmlns:soapenv="ht tp:// sc hem as. xmls ap .o rg/soap/env elope/" xmlns:ser="h tt p: //ser vice. sun at .go b .pe" xmlns:wsse="ht tp:// do cs. oasis- op en. org /wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <soapenv:Header> <wsse:Security> <wsse:UsernameToken> <wsse:Username>20100066603MODDATOS</wsse:Username> <wsse:Password>moddatos</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <ser:sendBill> <fileName>20100066603-01-F001-1.zip</fileName> <contentFile>cid:20100066603-01-F001-1.zip</contentFile> </ser:sendBill> </soapenv:Body> </soapenv:Envelope>
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
Web services y ws-security adebonis Internet 7 15-05-2015 01:54:54
Error "Message part {URL}Método was not recognized" al consumir servicio Web Java Al González Delphi para la web 0 02-05-2013 08:23:24
Web Security de Microsoft juanjose Varios 1 03-03-2012 12:32:06
Al consumir Servicio Web JAVA el array regresa vacio guacasoft73 Varios 1 15-05-2011 06:25:45


La franja horaria es GMT +2. Ahora son las 05:28:43.


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