Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Colaboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-11-2024
rdaniel2000 rdaniel2000 is offline
Miembro
 
Registrado: jun 2003
Posts: 17
Poder: 0
rdaniel2000 Va por buen camino
Hola

Oye es que estoy tratando de consumir el servicio pero obtengo esta respuesta:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</faultcode><faultstring xml:lang="en-US">An error occurred when verifying security for the message.</faultstring></s:Fault></s:Body></s:Envelope>


Lo mas probable es que no estoy enviando correctamente el Request...

Segun yo tengo validado el XML y verificadas todas las firmas...



<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><s:Header><ActivityId CorrelationId="c5478a6f-8f27-43f4-bc97-bea17612517c" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId><o:Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2024-11-28T19:35.59Z</u:Created><u:Expires>2024-11-29T19:35.59Z</u:Expires></u:Timestamp><o:BinarySecurityToken u:Id="uuid-baa2a981-3299-4361-b0b8-d68c7318e634-1" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">......................
</o:BinarySecurityToken><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#_0"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>Z+uB4zr2+2uXw7TEvdlAY2BFEh8=</DigestValue></Reference></SignedInfo><SignatureValue>.............................................</SignatureValue><KeyInfo><o:SecurityTokenReference>
<o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-baa2a981-3299-4361-b0b8-d68c7318e634-1"/>
</o:SecurityTokenReference></KeyInfo></Signature></o:Security></s:Header><s:Body><Autentica xmlns="http://DescargaMasivaTerceros.gob.mx"/></s:Body></s:Envelope>

All signatures were successfully verified.
Responder Con Cita
  #2  
Antiguo 28-11-2024
Avatar de pgranados
pgranados pgranados is offline
Miembro
 
Registrado: sep 2022
Ubicación: México
Posts: 318
Poder: 3
pgranados Va por buen camino
Ese error es por XML mal formado, por favor dime como calculas cada valor para orientarte un poco mas.
Responder Con Cita
  #3  
Antiguo 29-11-2024
rdaniel2000 rdaniel2000 is offline
Miembro
 
Registrado: jun 2003
Posts: 17
Poder: 0
rdaniel2000 Va por buen camino
Hola

Al parecer si tengo bien el XML, ahora tengo este error:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><s:Header><o:Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2024-11-29T02:16:13.913Z</u:Created><u:Expires>2024-11-29T02:21:13.913Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode><faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope>
Responder Con Cita
  #4  
Antiguo 29-11-2024
Avatar de pgranados
pgranados pgranados is offline
Miembro
 
Registrado: sep 2022
Ubicación: México
Posts: 318
Poder: 3
pgranados Va por buen camino
No, si tienes un error en el XML o en el envío de tu petición,

Para poder ayudarte necesito que me digas lo siguiente:

1. Estas consumiendo el webservice de autenticación o cual (autenticación, solicitud, consulta, descarga) ?
2. Como estas mandando la petición al webservice (headers, request, etc ?
3. En caso de ser el webservice de autenticación, como calculas los siguientes valores?

SignatureValue
DigestValue
Version del uuid generado


Saludos cordiales
Responder Con Cita
  #5  
Antiguo 29-11-2024
rdaniel2000 rdaniel2000 is offline
Miembro
 
Registrado: jun 2003
Posts: 17
Poder: 0
rdaniel2000 Va por buen camino
Ya revise el XML y pude duplicar el mismo XML de ejemplo de https://developers.sw.com.mx/knowled...uthenticacion/

Asi que creo que no es el xml..


Mas bien es como consumo el WebService... es que ahi es donde estoy perdido, no se como enviar el XML con THTTPRIO
Responder Con Cita
  #6  
Antiguo 06-12-2024
Maharba Maharba is offline
Registrado
 
Registrado: oct 2024
Posts: 3
Poder: 0
Maharba Va por buen camino
Hola rdaniel2000

¿Puedes enviar un ejemplo de como estas haciendo el envío de datos con THTTPRIO?
Responder Con Cita
  #7  
Antiguo 06-12-2024
rdaniel2000 rdaniel2000 is offline
Miembro
 
Registrado: jun 2003
Posts: 17
Poder: 0
rdaniel2000 Va por buen camino
Hola,

Es que no he sabido como enviar dicho xml.


Tengo la Funcion creada por el mismo Delphi y la con la cual mando llamar a la funcion del Web Service asi:

Código Delphi [-]
GetIAutenticacion(True, '', Nil).Autentica();

Pero como la funcion no tienen parametros, no se en que parte va el XML.

Gracias por la ayuda..



Código Delphi [-]

  IAutenticacion = interface(IInvokable)
  ['{A87F3A38-6E93-6F43-CEB6-B92C0862B638}']
    function  Autentica: string; stdcall;
  end;

function GetIAutenticacion(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IAutenticacion;
const
  defWSDL = 'https://cfdidescargamasivasolicitud.clouda.sat.gob.mx/Autenticacion/Autenticacion.svc?wsdl';
  defURL  = 'https://cfdidescargamasivasolicitud.clouda.sat.gob.mx/Autenticacion/Autenticacion.svc';
  defSvc  = 'Autenticacion';
  defPrt  = 'BasicHttpBinding_IAutenticacion';
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 IAutenticacion);
    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;
Responder Con Cita
Respuesta



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
Ayuda con modificacion masiva xeuz Firebird e Interbase 6 31-07-2013 08:57:08
Modificacion masiva Spynosa Firebird e Interbase 7 07-10-2010 06:06:05
insercion masiva Alfredo Firebird e Interbase 3 12-11-2008 20:34:46
Insercion masiva de una BD a otra BD oscjae Firebird e Interbase 5 15-12-2006 20:25:49
Inserción masiva en MySQL Morfo MySQL 3 09-01-2004 18:05:33


La franja horaria es GMT +2. Ahora son las 16:22:18.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi