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 14-07-2012
moran.j.e moran.j.e is offline
Registrado
NULL
 
Registrado: jul 2012
Posts: 1
Poder: 0
moran.j.e Va por buen camino
Autenticacion-soapheader

Hola a todos, estoy iniciandome en el desarrollo sobre delphi, no tengo mucha experiencia,y en el trabajo se me pidio que realice una conexión con un webservice ya existente "libro de quejas punto com".
Mi principal problema pasa por la autenticación HTTP, no se como construir la cabecera que contiene los datos de autenticación. A mi para realizar esta conexión se me dio "h..p://app.librodequejas.com/1/ws.php?wsdl" y lo que hago es crear un WSDL importer, el cual me crea la siguiente interfaz.
Código Delphi [-]
unit ws1;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  LDQ___Application_ServicesPortType = interface(IInvokable)
  ['{258099E3-2F62-F229-1C66-7114AF03208D}']
    function  listComplaints(const q: WideString; const id: integer): WideString; stdcall;
  end;

function GetLDQ___Application_ServicesPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): LDQ___Application_ServicesPortType;


implementation

function GetLDQ___Application_ServicesPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): LDQ___Application_ServicesPortType;
const
  defWSDL = 'h..p://app.librodequejas.com/1/ws.php?wsdl';
  defURL  = 'h..p://app.librodequejas.com/1/ws.php';
  defSvc  = 'LDQ - Application Services';
  defPrt  = 'LDQ - Application ServicesPort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  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 LDQ___Application_ServicesPortType);
    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;


initialization
  InvRegistry.RegisterInterface(TypeInfo(LDQ___Application_ServicesPortType), 'h..p://app.librodequejas.com/1/ws.php', 'ISO-8859-1', '', 'LDQ - Application ServicesPortType');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(LDQ___Application_ServicesPortType), 'h..p://app.librodequejas.com/1/ws.php/listComplaints');

end.

Por otra parte me facilitaron como realizarlo mediante php.

Código PHP:
  # Configuramos parámetros del cliente
                
$options = array();
                
$options['authentication'] = SOAP_AUTHENTICATION_BASIC;
                
$options['login'] = $CFG_username;
                
$options['password'] = $CFG_password;
                
$options['trace'] = true;
                
$options['encoding'] = 'ISO-8859-1';
               
                
# Creamos Cliente
                
$client = new SoapClientCFG_WSDL$options ); 
Espero que puedan ayudarme. Disculpas si abrí un hilo nuevo de algo ya solucionado, estuve buscando y no encontré algo que me pudiera ayudar.
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
Envio de correo con y sin autenticacion kharen Internet 4 30-05-2011 19:34:23
autenticacion de nmsmtp Yun-i Varios 0 25-02-2009 22:19:23
Autenticacion de Google Mail Emilio_82 Internet 5 13-09-2008 20:58:09
Autenticacion ZeosLib MS SQL Server JCarlosas Conexión con bases de datos 2 28-07-2007 17:41:59
Error de autenticacion 4-0 Conexión con bases de datos 4 15-02-2007 10:46:27


La franja horaria es GMT +2. Ahora son las 06:48:22.


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