Hola a todos, sucede que estoy tratando de crear un cliente de WebService desde File-->New-->Other-->webservice-->wsdl Importer (Delphi 7), la dirección de la especificación del WSDL es:
https://www2.ventanillaunica.gob.mx/...veService?wsdl Así se genera mi unidad y tras poner el componente HTTPRIO y configurar las propiedades WSDLLOCATION, SERVICE y PORT, agregando mi nueva unidad en el uses de mi unidad principal, procedo a compilar pero obtengo una serie de errores que hacen referencia al tipo de Parametros que estoy enviando en mis peticiones al WebService. ¿Eso indica que el WSDL es incorrecto, que falta definir algo, o que tengo que hacer algun tipo de modificación a la unidad de mi Webserver-cliente recien generado? Por lo que he leído en tutoriales acerca de la creación de Clientes de WebServices, todo deberia ser tan transparente como indicar la dirección del WSDL y unos cuantos Clicks. Anexo el código generado y los errores arrojados al momento de compilar. Gracias de antemano por la ayuda.
Errores:
[Error] RecibirCoveService.pas(45): Undeclared identifier: 'solicitarRecibirCoveServicio'
[Error] RecibirCoveService.pas(45): Undeclared identifier: 'solicitarRecibirCoveServicioResponse'
[Error] RecibirCoveService.pas(46): Undeclared identifier: 'solicitarRecibirRelacionFacturasIAServicio'
[Error] RecibirCoveService.pas(46): Undeclared identifier: 'solicitarRecibirRelacionFacturasIAServicioResponse'
[Error] RecibirCoveService.pas(47): Undeclared identifier: 'solicitarRecibirRelacionFacturasNoIAServicio'
[Error] RecibirCoveService.pas(47): Undeclared identifier: 'solicitarRecibirRelacionFacturasNoIAServicioResponse'
[Fatal Error] AAADAMM3.dpr(139): Could not compile used unit 'RecibirCoveService.pas'
Código:
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : https://www2.ventanillaunica.gob.mx/ventanilla/RecibirCoveService?wsdl
// Encoding : UTF-8
// Version : 1.0
// (30/11/2011 01:28:50 p.m. - 1.33.2.5)
// ************************************************************************ //
unit RecibirCoveService;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:solicitarRecibirCoveServicio - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// !:solicitarRecibirCoveServicioResponse - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// !:solicitarRecibirRelacionFacturasIAServicio - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// !:solicitarRecibirRelacionFacturasIAServicioResponse - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// !:solicitarRecibirRelacionFacturasNoIAServicio - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// !:solicitarRecibirRelacionFacturasNoIAServicioResponse - "http://www.ventanillaunica.gob.mx/cove/ws/oxml/"
// ************************************************************************ //
// Namespace : http://www.ventanillaunica.gob.mx/cove/ws/service/
// soapAction: http://www.ventanillaunica.gob.mx/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : IReceptorEndpointBinding
// service : RecibirCoveService
// port : IReceptorBinding
// URL : https://www2.ventanillaunica.gob.mx:5002/ventanilla/RecibirCoveService
// ************************************************************************ //
IReceptor = interface(IInvokable)
['{65A41149-B829-ABA1-4D2E-609AEDEE08A2}']
function RecibirCove(const peticion: solicitarRecibirCoveServicio): solicitarRecibirCoveServicioResponse; stdcall;
function RecibirRelacionFacturasIA(const peticion: solicitarRecibirRelacionFacturasIAServicio): solicitarRecibirRelacionFacturasIAServicioResponse; stdcall;
function RecibirRelacionFacturasNoIA(const peticion: solicitarRecibirRelacionFacturasNoIAServicio): solicitarRecibirRelacionFacturasNoIAServicioResponse; stdcall;
end;
function GetIReceptor(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IReceptor;
implementation
function GetIReceptor(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IReceptor;
const
defWSDL = 'https://www2.ventanillaunica.gob.mx/ventanilla/RecibirCoveService?wsdl';
defURL = 'https://www2.ventanillaunica.gob.mx:5002/ventanilla/RecibirCoveService';
defSvc = 'RecibirCoveService';
defPrt = 'IReceptorBinding';
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 IReceptor);
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(IReceptor), 'http://www.ventanillaunica.gob.mx/cove/ws/service/', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IReceptor), 'http://www.ventanillaunica.gob.mx/%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(IReceptor), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(IReceptor), ioLiteral);
end.