Recent

Author Topic: Problem with wsdl importer in wst 0.7  (Read 2316 times)

calebs

  • Full Member
  • ***
  • Posts: 190
Problem with wsdl importer in wst 0.7
« on: March 07, 2019, 06:32:20 am »
Hello all! Thanks for your help in advance!

I have 2 files i need to import. The first was created ok and gives no error when compiling but the second generates 3 files and an error when i try to compile.
Ill paste the files here, sorry for this long post, first the wsdl file and then the 3 files that generates the wizard in lazarus 2.0 with wst 0.7 installed from the online package manager included.
I'll remark where gives me the error. I have not much experience in objets nor xml but it seems that some declaration is missing in the third file (the proxy).
I don't know if its a bug in the importer, have tried many times varying checkboxes on wizard but always ends with this error.
I don't think the wsdl file is malformed, it's from the federal argentinian fiscal office (or something like that in english) is the file to negotiate the tokens for the electronic bill service.
Thanks again in advance for your help!

----------------------------- servwsaa.wsdl -----------------------------------
Code: Pascal  [Select][+][-]
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <wsdl:definitions targetNamespace="https://wsaahomo.afip.gov.ar/ws/services/LoginCms" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="https://wsaahomo.afip.gov.ar/ws/services/LoginCms" xmlns:intf="https://wsaahomo.afip.gov.ar/ws/services/LoginCms" xmlns:tns1="http://wsaa.view.sua.dvadac.desein.afip.gov" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3. <!--WSDL created by Apache Axis version: 1.4
  4. Built on Apr 22, 2006 (06:55:48 PDT)-->
  5.  <wsdl:types>
  6.   <schema elementFormDefault="qualified" targetNamespace="http://wsaa.view.sua.dvadac.desein.afip.gov" xmlns="http://www.w3.org/2001/XMLSchema">
  7.    <import namespace="https://wsaahomo.afip.gov.ar/ws/services/LoginCms"/>
  8.    <element name="loginCms">
  9.     <complexType>
  10.      <sequence>
  11.       <element name="in0" type="xsd:string"/>
  12.      </sequence>
  13.     </complexType>
  14.    </element>
  15.    <element name="loginCmsResponse">
  16.     <complexType>
  17.      <sequence>
  18.       <element name="loginCmsReturn" type="xsd:string"/>
  19.      </sequence>
  20.     </complexType>
  21.    </element>
  22.   </schema>
  23.   <schema elementFormDefault="qualified" targetNamespace="https://wsaahomo.afip.gov.ar/ws/services/LoginCms" xmlns="http://www.w3.org/2001/XMLSchema">
  24.    <complexType name="LoginFault">
  25.     <sequence/>
  26.    </complexType>
  27.    <element name="fault" type="impl:LoginFault"/>
  28.   </schema>
  29.  </wsdl:types>
  30.  
  31.    <wsdl:message name="loginCmsRequest">
  32.  
  33.       <wsdl:part element="tns1:loginCms" name="parameters"/>
  34.  
  35.    </wsdl:message>
  36.  
  37.    <wsdl:message name="LoginFault">
  38.  
  39.       <wsdl:part element="impl:fault" name="fault"/>
  40.  
  41.    </wsdl:message>
  42.  
  43.    <wsdl:message name="loginCmsResponse">
  44.  
  45.       <wsdl:part element="tns1:loginCmsResponse" name="parameters"/>
  46.  
  47.    </wsdl:message>
  48.  
  49.    <wsdl:portType name="LoginCMS">
  50.  
  51.       <wsdl:operation name="loginCms">
  52.  
  53.          <wsdl:input message="impl:loginCmsRequest" name="loginCmsRequest"/>
  54.  
  55.          <wsdl:output message="impl:loginCmsResponse" name="loginCmsResponse"/>
  56.  
  57.          <wsdl:fault message="impl:LoginFault" name="LoginFault"/>
  58.  
  59.       </wsdl:operation>
  60.  
  61.    </wsdl:portType>
  62.  
  63.    <wsdl:binding name="LoginCmsSoapBinding" type="impl:LoginCMS">
  64.  
  65.       <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  66.  
  67.       <wsdl:operation name="loginCms">
  68.  
  69.          <wsdlsoap:operation soapAction=""/>
  70.  
  71.          <wsdl:input name="loginCmsRequest">
  72.  
  73.             <wsdlsoap:body use="literal"/>
  74.  
  75.          </wsdl:input>
  76.  
  77.          <wsdl:output name="loginCmsResponse">
  78.  
  79.             <wsdlsoap:body use="literal"/>
  80.  
  81.          </wsdl:output>
  82.  
  83.          <wsdl:fault name="LoginFault">
  84.  
  85.             <wsdlsoap:fault name="LoginFault" use="literal"/>
  86.  
  87.          </wsdl:fault>
  88.  
  89.       </wsdl:operation>
  90.  
  91.    </wsdl:binding>
  92.  
  93.    <wsdl:service name="LoginCMSService">
  94.  
  95.       <wsdl:port binding="impl:LoginCmsSoapBinding" name="LoginCms">
  96.  
  97.          <wsdlsoap:address location="https://wsaahomo.afip.gov.ar/ws/services/LoginCms"/>
  98.  
  99.       </wsdl:port>
  100.  
  101.    </wsdl:service>
  102.  
  103. </wsdl:definitions>
  104.  
---------------------------------- end of file -------------------------------

-------------------------------- servwsaa.pas -----------------------------
Code: Pascal  [Select][+][-]
  1. {
  2. This unit has been produced by ws_helper.
  3.   Input unit name : "servwsaa".
  4.   This unit name  : "servwsaa".
  5.   Date            : "07/03/2019 01:34:23".
  6. }
  7. unit servwsaa;
  8. {$IFDEF FPC}
  9.   {$mode objfpc} {$H+}
  10. {$ENDIF}
  11. {$DEFINE WST_RECORD_RTTI}
  12. interface
  13.  
  14. uses SysUtils, Classes, TypInfo, base_service_intf, service_intf,
  15.      http_wsaa_view_sua_dvadac_desein_afip_gov;
  16.  
  17. const
  18.   sNAME_SPACE = 'https://wsaahomo.afip.gov.ar/ws/services/LoginCms';
  19.   sUNIT_NAME = 'servwsaa';
  20.  
  21. type
  22.  
  23.   LoginFault = class;
  24.  
  25.   fault = LoginFault;
  26.  
  27.   LoginFault = class(TBaseComplexRemotable)
  28.   end;
  29.  
  30.   LoginCMS = interface(IInvokable)
  31.     ['{3C1B7CC0-7982-47A3-B10F-29B586EF055D}']
  32.     function loginCms(
  33.       const  loginCmsParam : loginCms_Type
  34.     ):loginCmsResponse;
  35.   end;
  36.  
  37.   procedure Register_servwsaa_ServiceMetadata();
  38.  
  39. Implementation
  40. uses metadata_repository, record_rtti, wst_types;
  41.  
  42.  
  43. procedure Register_servwsaa_ServiceMetadata();
  44. var
  45.   mm : IModuleMetadataMngr;
  46. begin
  47.   mm := GetModuleMetadataMngr();
  48.   mm.SetRepositoryNameSpace(sUNIT_NAME, sNAME_SPACE);
  49.   mm.SetRepositoryCustomData(sUNIT_NAME, 'elementFormDefault', 'qualified');
  50.   mm.SetServiceCustomData(
  51.     sUNIT_NAME,
  52.     'LoginCMS',
  53.     'TRANSPORT_Address',
  54.     'https://wsaahomo.afip.gov.ar/ws/services/LoginCms'
  55.   );
  56.   mm.SetServiceCustomData(
  57.     sUNIT_NAME,
  58.     'LoginCMS',
  59.     'FORMAT_Style',
  60.     'document'
  61.   );
  62.   mm.SetOperationCustomData(
  63.     sUNIT_NAME,
  64.     'LoginCMS',
  65.     'loginCms',
  66.     '_E_N_',
  67.     'loginCms'
  68.   );
  69.   mm.SetOperationCustomData(
  70.     sUNIT_NAME,
  71.     'LoginCMS',
  72.     'loginCms',
  73.     'TRANSPORT_soapAction',
  74.     ''
  75.   );
  76.   mm.SetOperationCustomData(
  77.     sUNIT_NAME,
  78.     'LoginCMS',
  79.     'loginCms',
  80.     'FORMAT_Input_EncodingStyle',
  81.     'literal'
  82.   );
  83.   mm.SetOperationCustomData(
  84.     sUNIT_NAME,
  85.     'LoginCMS',
  86.     'loginCms',
  87.     'FORMAT_OutputEncodingStyle',
  88.     'literal'
  89.   );
  90. end;
  91.  
  92.  
  93. var
  94.   typeRegistryInstance : TTypeRegistry = nil;
  95. initialization
  96.   typeRegistryInstance := GetTypeRegistry();
  97.  
  98.   typeRegistryInstance.Register(sNAME_SPACE,TypeInfo(LoginFault),'LoginFault',[trioqualifiedElement]);
  99.  
  100.  
  101.  
  102. End.
  103.  
---------------------------------- end of file -------------------------------

-------------------http_wsaa_view_sua_dvadac_desein_afip_gov.pas-------------------------
Code: Pascal  [Select][+][-]
  1. {
  2. This unit has been produced by ws_helper.
  3.   Input unit name : "http_wsaa_view_sua_dvadac_desein_afip_gov".
  4.   This unit name  : "http_wsaa_view_sua_dvadac_desein_afip_gov".
  5.   Date            : "07/03/2019 01:34:23".
  6. }
  7. unit http_wsaa_view_sua_dvadac_desein_afip_gov;
  8. {$IFDEF FPC}
  9.   {$mode objfpc} {$H+}
  10. {$ENDIF}
  11. {$DEFINE WST_RECORD_RTTI}
  12. interface
  13.  
  14. uses SysUtils, Classes, TypInfo, base_service_intf, service_intf;
  15.  
  16. const
  17.   sNAME_SPACE = 'http://wsaa.view.sua.dvadac.desein.afip.gov';
  18.   sUNIT_NAME = 'http_wsaa_view_sua_dvadac_desein_afip_gov';
  19.  
  20. type
  21.  
  22.   loginCms_Type = class;
  23.   loginCmsResponse = class;
  24.  
  25.   loginCms_Type = class(TBaseComplexRemotable)
  26.   private
  27.     Fin0 : UnicodeString;
  28.   published
  29.     property in0 : UnicodeString read Fin0 write Fin0;
  30.   end;
  31.  
  32.   loginCmsResponse = class(TBaseComplexRemotable)
  33.   private
  34.     FloginCmsReturn : UnicodeString;
  35.   published
  36.     property loginCmsReturn : UnicodeString read FloginCmsReturn write FloginCmsReturn;
  37.   end;
  38.  
  39. Implementation
  40. uses metadata_repository, record_rtti, wst_types;
  41.  
  42.  
  43. var
  44.   typeRegistryInstance : TTypeRegistry = nil;
  45. initialization
  46.   typeRegistryInstance := GetTypeRegistry();
  47.  
  48.   typeRegistryInstance.Register(sNAME_SPACE,TypeInfo(loginCms_Type),'loginCms',[trioqualifiedElement]);
  49.   typeRegistryInstance.Register(sNAME_SPACE,TypeInfo(loginCmsResponse),'loginCmsResponse',[trioqualifiedElement]);
  50.  
  51.  
  52.  
  53. End.
  54.  
---------------------------------- end of file -------------------------------

---------------------- servwsaa_proxy.pas------------------------------
Code: Pascal  [Select][+][-]
  1. {
  2. This unit has been produced by ws_helper.
  3.   Input unit name : "servwsaa".
  4.   This unit name  : "servwsaa_proxy".
  5.   Date            : "07/03/2019 01:34:23".
  6. }
  7.  
  8. Unit servwsaa_proxy;
  9. {$IFDEF FPC} {$mode objfpc}{$H+} {$ENDIF}
  10. Interface
  11.  
  12. Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, servwsaa,
  13.      http_wsaa_view_sua_dvadac_desein_afip_gov;
  14.  
  15. Type
  16.  
  17.  
  18.   TLoginCMS_Proxy=class(TBaseProxy,http_wsaa_view_sua_dvadac_desein_afip_gov.LoginCMS) [b][i]<<<<< servwsaa_proxy.pas(18,86) Error: Identifier not found "http_wsaa_view_sua_dvadac_desein_afip_gov"[/i][/b]
  19.   Protected
  20.     class function GetServiceType() : PTypeInfo;override;
  21.     function loginCms(
  22.       const  loginCmsParam : loginCms_Type
  23.     ):loginCmsResponse;
  24.   End;
  25.  
  26.   Function wst_CreateInstance_LoginCMS(const AFormat : string = 'SOAP:'; const ATransport : string = 'HTTP:'; const AAddress : string = ''):LoginCMS;
  27.  
  28. Implementation
  29. uses wst_resources_imp, metadata_repository;
  30.  
  31.  
  32. Function wst_CreateInstance_LoginCMS(const AFormat : string; const ATransport : string; const AAddress : string):LoginCMS;
  33. Var
  34.   locAdr : string;
  35. Begin
  36.   locAdr := AAddress;
  37.   if ( locAdr = '' ) then
  38.     locAdr := GetServiceDefaultAddress(TypeInfo(LoginCMS));
  39.   Result := TLoginCMS_Proxy.Create('LoginCMS',AFormat+GetServiceDefaultFormatProperties(TypeInfo(LoginCMS)),ATransport + 'address=' + locAdr);
  40. End;
  41.  
  42. { TLoginCMS_Proxy implementation }
  43.  
  44. class function TLoginCMS_Proxy.GetServiceType() : PTypeInfo;
  45. begin
  46.   result := TypeInfo(http_wsaa_view_sua_dvadac_desein_afip_gov.LoginCMS);
  47. end;
  48.  
  49. function TLoginCMS_Proxy.loginCms(
  50.   const  loginCmsParam : loginCms_Type
  51. ):loginCmsResponse;
  52. Var
  53.   locSerializer : IFormatterClient;
  54.   locCallContext : ICallContext;
  55.   locStrPrmName : string;
  56. Begin
  57.   locCallContext := Self as ICallContext;
  58.   locSerializer := GetSerializer();
  59.   Try
  60.     locSerializer.BeginCall('loginCms', GetTarget(),locCallContext);
  61.       locSerializer.Put('loginCms', TypeInfo(loginCms_Type), loginCmsParam);
  62.     locSerializer.EndCall();
  63.  
  64.     MakeCall();
  65.  
  66.     locSerializer.BeginCallRead(locCallContext);
  67.       Result := Nil;
  68.       locStrPrmName := 'loginCmsResponse';
  69.       locSerializer.Get(TypeInfo(loginCmsResponse), locStrPrmName, Result);
  70.  
  71.   Finally
  72.     locSerializer.Clear();
  73.   End;
  74. End;
  75.  
  76.  
  77. initialization
  78.   {$i servwsaa.wst}
  79.  
  80.   {$IF DECLARED(Register_servwsaa_ServiceMetadata)}
  81.   Register_servwsaa_ServiceMetadata();
  82.   {$IFEND}
  83. End.
  84.  
---------------------------------- end of file -------------------------------

 

TinyPortal © 2005-2018