Advertisement
Guest User

Untitled

a guest
Feb 12th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 24.23 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7.   Vcl.Controls, Vcl.StdCtrls, Vcl.Forms, Vcl.Dialogs,
  8.   checkVatService;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.     procedure FormCreate(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.   WS: checkVatPortType;
  24.  
  25. implementation
  26.  
  27. {$R *.dfm}
  28.  
  29.  
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. var
  32.   inp: checkVat;
  33.   outp: checkVatResponse;
  34. begin
  35.   inp := checkVat.Create;
  36.   try
  37.     inp.countryCode := 'NL';   //Copy(edVAT.Text,1,Pos(#32,edVAT.Text)-1);
  38.     inp.vatNumber := '195846266B01';   //Copy(edVAT.Text,Pos(#32,edVAT.Text)+1,255);
  39.     outp := WS.checkVat(inp);
  40.     if outp.valid then
  41.       ShowMessage('OK: ' + outp.name_ + #13#10 + outp.address)
  42.     else
  43.       ShowMessage(outp.vatNumber + ' not OK')
  44.   finally
  45.     inp.Free;
  46.     outp.Free
  47.   end
  48. end;
  49.  
  50. procedure TForm1.FormCreate(Sender: TObject);
  51. begin
  52.   WS := GetcheckVatPortType(False, 'http://invalid_url');
  53. end;
  54.  
  55. end.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. // ************************************************************************ //
  66. // The types declared in this file were generated from data read from the
  67. // WSDL File described below:
  68. // WSDL     : D:\N\Testy SOAP\checkVatService.wsdl.xml
  69. //  >Import : D:\N\Testy SOAP\checkVatService.wsdl.xml>0
  70. // Encoding : UTF-8
  71. // Version  : 1.0
  72. // (2015-01-29 13:12:34 - - $Rev: 69934 $)
  73. // ************************************************************************ //
  74.  
  75. unit checkVatService;
  76.  
  77. interface
  78.  
  79. uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
  80.  
  81. const
  82.   IS_OPTN = $0001;
  83.   IS_NLBL = $0004;
  84.   IS_REF  = $0080;
  85.  
  86.  
  87. type
  88.  
  89.   // ************************************************************************ //
  90.   // The following types, referred to in the WSDL document are not being represented
  91.   // in this file. They are either aliases[@] of other types represented or were referred
  92.   // to but never[!] declared in the document. The types from the latter category
  93.   // typically map to predefined/known XML or Embarcadero types; however, they could also
  94.   // indicate incorrect WSDL documents that failed to declare or import a schema type.
  95.   // ************************************************************************ //
  96.   // !:boolean         - "http://www.w3.org/2001/XMLSchema"[Gbl]
  97.   // !:date            - "http://www.w3.org/2001/XMLSchema"[Gbl]
  98.   // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]
  99.  
  100.   checkVatResponse     = class;                 { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Lit][GblElm] }
  101.   checkVatApprox       = class;                 { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Lit][GblElm] }
  102.   checkVat             = class;                 { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Lit][GblElm] }
  103.   checkVatApproxResponse = class;               { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Lit][GblElm] }
  104.  
  105.   {$SCOPEDENUMS ON}
  106.   { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[GblSmpl] }
  107.   matchCode = (_1, _2, _3);
  108.  
  109.   {$SCOPEDENUMS OFF}
  110.  
  111.  
  112.  
  113.   // ************************************************************************ //
  114.   // XML       : checkVatResponse, global, <element>
  115.   // Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
  116.   // Serializtn: [xoLiteralParam]
  117.   // Info      : Wrapper
  118.   // ************************************************************************ //
  119.   checkVatResponse = class(TRemotable)
  120.   private
  121.     FcountryCode: string;
  122.     FvatNumber: string;
  123.     FrequestDate: TXSDate;
  124.     Fvalid: Boolean;
  125.     Fname_: string;
  126.     Fname__Specified: boolean;
  127.     Faddress: string;
  128.     Faddress_Specified: boolean;
  129.     procedure Setname_(Index: Integer; const Astring: string);
  130.     function  name__Specified(Index: Integer): boolean;
  131.     procedure Setaddress(Index: Integer; const Astring: string);
  132.     function  address_Specified(Index: Integer): boolean;
  133.   public
  134.     constructor Create; override;
  135.     destructor Destroy; override;
  136.   published
  137.     property countryCode: string   read FcountryCode write FcountryCode;
  138.     property vatNumber:   string   read FvatNumber write FvatNumber;
  139.     property requestDate: TXSDate  read FrequestDate write FrequestDate;
  140.     property valid:       Boolean  read Fvalid write Fvalid;
  141.     property name_:       string   Index (IS_OPTN or IS_NLBL) read Fname_ write Setname_ stored name__Specified;
  142.     property address:     string   Index (IS_OPTN or IS_NLBL) read Faddress write Setaddress stored address_Specified;
  143.   end;
  144.  
  145.   companyTypeCode =  type string;      { "urn:ec.europa.eu:taxud:vies:services:checkVat:types"[GblSmpl] }
  146.  
  147.  
  148.   // ************************************************************************ //
  149.   // XML       : checkVatApprox, global, <element>
  150.   // Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
  151.   // Serializtn: [xoLiteralParam]
  152.   // Info      : Wrapper
  153.   // ************************************************************************ //
  154.   checkVatApprox = class(TRemotable)
  155.   private
  156.     FcountryCode: string;
  157.     FvatNumber: string;
  158.     FtraderName: string;
  159.     FtraderName_Specified: boolean;
  160.     FtraderCompanyType: companyTypeCode;
  161.     FtraderCompanyType_Specified: boolean;
  162.     FtraderStreet: string;
  163.     FtraderStreet_Specified: boolean;
  164.     FtraderPostcode: string;
  165.     FtraderPostcode_Specified: boolean;
  166.     FtraderCity: string;
  167.     FtraderCity_Specified: boolean;
  168.     FrequesterCountryCode: string;
  169.     FrequesterCountryCode_Specified: boolean;
  170.     FrequesterVatNumber: string;
  171.     FrequesterVatNumber_Specified: boolean;
  172.     procedure SettraderName(Index: Integer; const Astring: string);
  173.     function  traderName_Specified(Index: Integer): boolean;
  174.     procedure SettraderCompanyType(Index: Integer; const AcompanyTypeCode: companyTypeCode);
  175.     function  traderCompanyType_Specified(Index: Integer): boolean;
  176.     procedure SettraderStreet(Index: Integer; const Astring: string);
  177.     function  traderStreet_Specified(Index: Integer): boolean;
  178.     procedure SettraderPostcode(Index: Integer; const Astring: string);
  179.     function  traderPostcode_Specified(Index: Integer): boolean;
  180.     procedure SettraderCity(Index: Integer; const Astring: string);
  181.     function  traderCity_Specified(Index: Integer): boolean;
  182.     procedure SetrequesterCountryCode(Index: Integer; const Astring: string);
  183.     function  requesterCountryCode_Specified(Index: Integer): boolean;
  184.     procedure SetrequesterVatNumber(Index: Integer; const Astring: string);
  185.     function  requesterVatNumber_Specified(Index: Integer): boolean;
  186.   public
  187.     constructor Create; override;
  188.   published
  189.     property countryCode:          string           read FcountryCode write FcountryCode;
  190.     property vatNumber:            string           read FvatNumber write FvatNumber;
  191.     property traderName:           string           Index (IS_OPTN) read FtraderName write SettraderName stored traderName_Specified;
  192.     property traderCompanyType:    companyTypeCode  Index (IS_OPTN) read FtraderCompanyType write SettraderCompanyType stored traderCompanyType_Specified;
  193.     property traderStreet:         string           Index (IS_OPTN) read FtraderStreet write SettraderStreet stored traderStreet_Specified;
  194.     property traderPostcode:       string           Index (IS_OPTN) read FtraderPostcode write SettraderPostcode stored traderPostcode_Specified;
  195.     property traderCity:           string           Index (IS_OPTN) read FtraderCity write SettraderCity stored traderCity_Specified;
  196.     property requesterCountryCode: string           Index (IS_OPTN) read FrequesterCountryCode write SetrequesterCountryCode stored requesterCountryCode_Specified;
  197.     property requesterVatNumber:   string           Index (IS_OPTN) read FrequesterVatNumber write SetrequesterVatNumber stored requesterVatNumber_Specified;
  198.   end;
  199.  
  200.  
  201.  
  202.   // ************************************************************************ //
  203.   // XML       : checkVat, global, <element>
  204.   // Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
  205.   // Serializtn: [xoLiteralParam]
  206.   // Info      : Wrapper
  207.   // ************************************************************************ //
  208.   checkVat = class(TRemotable)
  209.   private
  210.     FcountryCode: string;
  211.     FvatNumber: string;
  212.   public
  213.     constructor Create; override;
  214.   published
  215.     property countryCode: string  read FcountryCode write FcountryCode;
  216.     property vatNumber:   string  read FvatNumber write FvatNumber;
  217.   end;
  218.  
  219.  
  220.  
  221.   // ************************************************************************ //
  222.   // XML       : checkVatApproxResponse, global, <element>
  223.   // Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
  224.   // Serializtn: [xoLiteralParam]
  225.   // Info      : Wrapper
  226.   // ************************************************************************ //
  227.   checkVatApproxResponse = class(TRemotable)
  228.   private
  229.     FcountryCode: string;
  230.     FvatNumber: string;
  231.     FrequestDate: TXSDate;
  232.     Fvalid: Boolean;
  233.     FtraderName: string;
  234.     FtraderName_Specified: boolean;
  235.     FtraderCompanyType: companyTypeCode;
  236.     FtraderCompanyType_Specified: boolean;
  237.     FtraderAddress: string;
  238.     FtraderAddress_Specified: boolean;
  239.     FtraderStreet: string;
  240.     FtraderStreet_Specified: boolean;
  241.     FtraderPostcode: string;
  242.     FtraderPostcode_Specified: boolean;
  243.     FtraderCity: string;
  244.     FtraderCity_Specified: boolean;
  245.     FtraderNameMatch: matchCode;
  246.     FtraderNameMatch_Specified: boolean;
  247.     FtraderCompanyTypeMatch: matchCode;
  248.     FtraderCompanyTypeMatch_Specified: boolean;
  249.     FtraderStreetMatch: matchCode;
  250.     FtraderStreetMatch_Specified: boolean;
  251.     FtraderPostcodeMatch: matchCode;
  252.     FtraderPostcodeMatch_Specified: boolean;
  253.     FtraderCityMatch: matchCode;
  254.     FtraderCityMatch_Specified: boolean;
  255.     FrequestIdentifier: string;
  256.     procedure SettraderName(Index: Integer; const Astring: string);
  257.     function  traderName_Specified(Index: Integer): boolean;
  258.     procedure SettraderCompanyType(Index: Integer; const AcompanyTypeCode: companyTypeCode);
  259.     function  traderCompanyType_Specified(Index: Integer): boolean;
  260.     procedure SettraderAddress(Index: Integer; const Astring: string);
  261.     function  traderAddress_Specified(Index: Integer): boolean;
  262.     procedure SettraderStreet(Index: Integer; const Astring: string);
  263.     function  traderStreet_Specified(Index: Integer): boolean;
  264.     procedure SettraderPostcode(Index: Integer; const Astring: string);
  265.     function  traderPostcode_Specified(Index: Integer): boolean;
  266.     procedure SettraderCity(Index: Integer; const Astring: string);
  267.     function  traderCity_Specified(Index: Integer): boolean;
  268.     procedure SettraderNameMatch(Index: Integer; const AmatchCode: matchCode);
  269.     function  traderNameMatch_Specified(Index: Integer): boolean;
  270.     procedure SettraderCompanyTypeMatch(Index: Integer; const AmatchCode: matchCode);
  271.     function  traderCompanyTypeMatch_Specified(Index: Integer): boolean;
  272.     procedure SettraderStreetMatch(Index: Integer; const AmatchCode: matchCode);
  273.     function  traderStreetMatch_Specified(Index: Integer): boolean;
  274.     procedure SettraderPostcodeMatch(Index: Integer; const AmatchCode: matchCode);
  275.     function  traderPostcodeMatch_Specified(Index: Integer): boolean;
  276.     procedure SettraderCityMatch(Index: Integer; const AmatchCode: matchCode);
  277.     function  traderCityMatch_Specified(Index: Integer): boolean;
  278.   public
  279.     constructor Create; override;
  280.     destructor Destroy; override;
  281.   published
  282.     property countryCode:            string           read FcountryCode write FcountryCode;
  283.     property vatNumber:              string           read FvatNumber write FvatNumber;
  284.     property requestDate:            TXSDate          read FrequestDate write FrequestDate;
  285.     property valid:                  Boolean          read Fvalid write Fvalid;
  286.     property traderName:             string           Index (IS_OPTN or IS_NLBL) read FtraderName write SettraderName stored traderName_Specified;
  287.     property traderCompanyType:      companyTypeCode  Index (IS_OPTN or IS_NLBL) read FtraderCompanyType write SettraderCompanyType stored traderCompanyType_Specified;
  288.     property traderAddress:          string           Index (IS_OPTN) read FtraderAddress write SettraderAddress stored traderAddress_Specified;
  289.     property traderStreet:           string           Index (IS_OPTN) read FtraderStreet write SettraderStreet stored traderStreet_Specified;
  290.     property traderPostcode:         string           Index (IS_OPTN) read FtraderPostcode write SettraderPostcode stored traderPostcode_Specified;
  291.     property traderCity:             string           Index (IS_OPTN) read FtraderCity write SettraderCity stored traderCity_Specified;
  292.     property traderNameMatch:        matchCode        Index (IS_OPTN) read FtraderNameMatch write SettraderNameMatch stored traderNameMatch_Specified;
  293.     property traderCompanyTypeMatch: matchCode        Index (IS_OPTN) read FtraderCompanyTypeMatch write SettraderCompanyTypeMatch stored traderCompanyTypeMatch_Specified;
  294.     property traderStreetMatch:      matchCode        Index (IS_OPTN) read FtraderStreetMatch write SettraderStreetMatch stored traderStreetMatch_Specified;
  295.     property traderPostcodeMatch:    matchCode        Index (IS_OPTN) read FtraderPostcodeMatch write SettraderPostcodeMatch stored traderPostcodeMatch_Specified;
  296.     property traderCityMatch:        matchCode        Index (IS_OPTN) read FtraderCityMatch write SettraderCityMatch stored traderCityMatch_Specified;
  297.     property requestIdentifier:      string           read FrequestIdentifier write FrequestIdentifier;
  298.   end;
  299.  
  300.  
  301.   // ************************************************************************ //
  302.   // Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat
  303.   // transport : http://schemas.xmlsoap.org/soap/http
  304.   // style     : document
  305.   // use       : literal
  306.   // binding   : checkVatBinding
  307.   // service   : checkVatService
  308.   // port      : checkVatPort
  309.   // URL       : http://ec.europa.eu/taxation_customs/vies/services/checkVatService
  310.   // ************************************************************************ //
  311.   checkVatPortType = interface(IInvokable)
  312.   ['{0F901373-2432-32E2-C99D-95B53AE83C79}']
  313.  
  314.     // Cannot unwrap:
  315.     //     - More than one strictly out element was found
  316.     function  checkVat(const parameters: checkVat): checkVatResponse; stdcall;
  317.  
  318.     // Cannot unwrap:
  319.     //     - More than one strictly out element was found
  320.     function  checkVatApprox(const parameters: checkVatApprox): checkVatApproxResponse; stdcall;
  321.   end;
  322.  
  323. function GetcheckVatPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): checkVatPortType;
  324.  
  325.  
  326. implementation
  327.   uses System.SysUtils;
  328.  
  329. function GetcheckVatPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): checkVatPortType;
  330. const
  331.   defWSDL = 'D:\N\Testy SOAP\checkVatService.wsdl.xml';
  332.   defURL  = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService';
  333.   defSvc  = 'checkVatService';
  334.   defPrt  = 'checkVatPort';
  335. var
  336.   RIO: THTTPRIO;
  337. begin
  338.   Result := nil;
  339.   if (Addr = '') then
  340.   begin
  341.     if UseWSDL then
  342.       Addr := defWSDL
  343.     else
  344.       Addr := defURL;
  345.   end;
  346.   if HTTPRIO = nil then
  347.     RIO := THTTPRIO.Create(nil)
  348.   else
  349.     RIO := HTTPRIO;
  350.   try
  351.     Result := (RIO as checkVatPortType);
  352.     if UseWSDL then
  353.     begin
  354.       RIO.WSDLLocation := Addr;
  355.       RIO.Service := defSvc;
  356.       RIO.Port := defPrt;
  357.     end else
  358.       RIO.URL := Addr;
  359.   finally
  360.     if (Result = nil) and (HTTPRIO = nil) then
  361.       RIO.Free;
  362.   end;
  363. end;
  364.  
  365.  
  366. constructor checkVatResponse.Create;
  367. begin
  368.   inherited Create;
  369.   FSerializationOptions := [xoLiteralParam];
  370. end;
  371.  
  372. destructor checkVatResponse.Destroy;
  373. begin
  374.   System.SysUtils.FreeAndNil(FrequestDate);
  375.   inherited Destroy;
  376. end;
  377.  
  378. procedure checkVatResponse.Setname_(Index: Integer; const Astring: string);
  379. begin
  380.   Fname_ := Astring;
  381.   Fname__Specified := True;
  382. end;
  383.  
  384. function checkVatResponse.name__Specified(Index: Integer): boolean;
  385. begin
  386.   Result := Fname__Specified;
  387. end;
  388.  
  389. procedure checkVatResponse.Setaddress(Index: Integer; const Astring: string);
  390. begin
  391.   Faddress := Astring;
  392.   Faddress_Specified := True;
  393. end;
  394.  
  395. function checkVatResponse.address_Specified(Index: Integer): boolean;
  396. begin
  397.   Result := Faddress_Specified;
  398. end;
  399.  
  400. constructor checkVatApprox.Create;
  401. begin
  402.   inherited Create;
  403.   FSerializationOptions := [xoLiteralParam];
  404. end;
  405.  
  406. procedure checkVatApprox.SettraderName(Index: Integer; const Astring: string);
  407. begin
  408.   FtraderName := Astring;
  409.   FtraderName_Specified := True;
  410. end;
  411.  
  412. function checkVatApprox.traderName_Specified(Index: Integer): boolean;
  413. begin
  414.   Result := FtraderName_Specified;
  415. end;
  416.  
  417. procedure checkVatApprox.SettraderCompanyType(Index: Integer; const AcompanyTypeCode: companyTypeCode);
  418. begin
  419.   FtraderCompanyType := AcompanyTypeCode;
  420.   FtraderCompanyType_Specified := True;
  421. end;
  422.  
  423. function checkVatApprox.traderCompanyType_Specified(Index: Integer): boolean;
  424. begin
  425.   Result := FtraderCompanyType_Specified;
  426. end;
  427.  
  428. procedure checkVatApprox.SettraderStreet(Index: Integer; const Astring: string);
  429. begin
  430.   FtraderStreet := Astring;
  431.   FtraderStreet_Specified := True;
  432. end;
  433.  
  434. function checkVatApprox.traderStreet_Specified(Index: Integer): boolean;
  435. begin
  436.   Result := FtraderStreet_Specified;
  437. end;
  438.  
  439. procedure checkVatApprox.SettraderPostcode(Index: Integer; const Astring: string);
  440. begin
  441.   FtraderPostcode := Astring;
  442.   FtraderPostcode_Specified := True;
  443. end;
  444.  
  445. function checkVatApprox.traderPostcode_Specified(Index: Integer): boolean;
  446. begin
  447.   Result := FtraderPostcode_Specified;
  448. end;
  449.  
  450. procedure checkVatApprox.SettraderCity(Index: Integer; const Astring: string);
  451. begin
  452.   FtraderCity := Astring;
  453.   FtraderCity_Specified := True;
  454. end;
  455.  
  456. function checkVatApprox.traderCity_Specified(Index: Integer): boolean;
  457. begin
  458.   Result := FtraderCity_Specified;
  459. end;
  460.  
  461. procedure checkVatApprox.SetrequesterCountryCode(Index: Integer; const Astring: string);
  462. begin
  463.   FrequesterCountryCode := Astring;
  464.   FrequesterCountryCode_Specified := True;
  465. end;
  466.  
  467. function checkVatApprox.requesterCountryCode_Specified(Index: Integer): boolean;
  468. begin
  469.   Result := FrequesterCountryCode_Specified;
  470. end;
  471.  
  472. procedure checkVatApprox.SetrequesterVatNumber(Index: Integer; const Astring: string);
  473. begin
  474.   FrequesterVatNumber := Astring;
  475.   FrequesterVatNumber_Specified := True;
  476. end;
  477.  
  478. function checkVatApprox.requesterVatNumber_Specified(Index: Integer): boolean;
  479. begin
  480.   Result := FrequesterVatNumber_Specified;
  481. end;
  482.  
  483. constructor checkVat.Create;
  484. begin
  485.   inherited Create;
  486.   FSerializationOptions := [xoLiteralParam];
  487. end;
  488.  
  489. constructor checkVatApproxResponse.Create;
  490. begin
  491.   inherited Create;
  492.   FSerializationOptions := [xoLiteralParam];
  493. end;
  494.  
  495. destructor checkVatApproxResponse.Destroy;
  496. begin
  497.   System.SysUtils.FreeAndNil(FrequestDate);
  498.   inherited Destroy;
  499. end;
  500.  
  501. procedure checkVatApproxResponse.SettraderName(Index: Integer; const Astring: string);
  502. begin
  503.   FtraderName := Astring;
  504.   FtraderName_Specified := True;
  505. end;
  506.  
  507. function checkVatApproxResponse.traderName_Specified(Index: Integer): boolean;
  508. begin
  509.   Result := FtraderName_Specified;
  510. end;
  511.  
  512. procedure checkVatApproxResponse.SettraderCompanyType(Index: Integer; const AcompanyTypeCode: companyTypeCode);
  513. begin
  514.   FtraderCompanyType := AcompanyTypeCode;
  515.   FtraderCompanyType_Specified := True;
  516. end;
  517.  
  518. function checkVatApproxResponse.traderCompanyType_Specified(Index: Integer): boolean;
  519. begin
  520.   Result := FtraderCompanyType_Specified;
  521. end;
  522.  
  523. procedure checkVatApproxResponse.SettraderAddress(Index: Integer; const Astring: string);
  524. begin
  525.   FtraderAddress := Astring;
  526.   FtraderAddress_Specified := True;
  527. end;
  528.  
  529. function checkVatApproxResponse.traderAddress_Specified(Index: Integer): boolean;
  530. begin
  531.   Result := FtraderAddress_Specified;
  532. end;
  533.  
  534. procedure checkVatApproxResponse.SettraderStreet(Index: Integer; const Astring: string);
  535. begin
  536.   FtraderStreet := Astring;
  537.   FtraderStreet_Specified := True;
  538. end;
  539.  
  540. function checkVatApproxResponse.traderStreet_Specified(Index: Integer): boolean;
  541. begin
  542.   Result := FtraderStreet_Specified;
  543. end;
  544.  
  545. procedure checkVatApproxResponse.SettraderPostcode(Index: Integer; const Astring: string);
  546. begin
  547.   FtraderPostcode := Astring;
  548.   FtraderPostcode_Specified := True;
  549. end;
  550.  
  551. function checkVatApproxResponse.traderPostcode_Specified(Index: Integer): boolean;
  552. begin
  553.   Result := FtraderPostcode_Specified;
  554. end;
  555.  
  556. procedure checkVatApproxResponse.SettraderCity(Index: Integer; const Astring: string);
  557. begin
  558.   FtraderCity := Astring;
  559.   FtraderCity_Specified := True;
  560. end;
  561.  
  562. function checkVatApproxResponse.traderCity_Specified(Index: Integer): boolean;
  563. begin
  564.   Result := FtraderCity_Specified;
  565. end;
  566.  
  567. procedure checkVatApproxResponse.SettraderNameMatch(Index: Integer; const AmatchCode: matchCode);
  568. begin
  569.   FtraderNameMatch := AmatchCode;
  570.   FtraderNameMatch_Specified := True;
  571. end;
  572.  
  573. function checkVatApproxResponse.traderNameMatch_Specified(Index: Integer): boolean;
  574. begin
  575.   Result := FtraderNameMatch_Specified;
  576. end;
  577.  
  578. procedure checkVatApproxResponse.SettraderCompanyTypeMatch(Index: Integer; const AmatchCode: matchCode);
  579. begin
  580.   FtraderCompanyTypeMatch := AmatchCode;
  581.   FtraderCompanyTypeMatch_Specified := True;
  582. end;
  583.  
  584. function checkVatApproxResponse.traderCompanyTypeMatch_Specified(Index: Integer): boolean;
  585. begin
  586.   Result := FtraderCompanyTypeMatch_Specified;
  587. end;
  588.  
  589. procedure checkVatApproxResponse.SettraderStreetMatch(Index: Integer; const AmatchCode: matchCode);
  590. begin
  591.   FtraderStreetMatch := AmatchCode;
  592.   FtraderStreetMatch_Specified := True;
  593. end;
  594.  
  595. function checkVatApproxResponse.traderStreetMatch_Specified(Index: Integer): boolean;
  596. begin
  597.   Result := FtraderStreetMatch_Specified;
  598. end;
  599.  
  600. procedure checkVatApproxResponse.SettraderPostcodeMatch(Index: Integer; const AmatchCode: matchCode);
  601. begin
  602.   FtraderPostcodeMatch := AmatchCode;
  603.   FtraderPostcodeMatch_Specified := True;
  604. end;
  605.  
  606. function checkVatApproxResponse.traderPostcodeMatch_Specified(Index: Integer): boolean;
  607. begin
  608.   Result := FtraderPostcodeMatch_Specified;
  609. end;
  610.  
  611. procedure checkVatApproxResponse.SettraderCityMatch(Index: Integer; const AmatchCode: matchCode);
  612. begin
  613.   FtraderCityMatch := AmatchCode;
  614.   FtraderCityMatch_Specified := True;
  615. end;
  616.  
  617. function checkVatApproxResponse.traderCityMatch_Specified(Index: Integer): boolean;
  618. begin
  619.   Result := FtraderCityMatch_Specified;
  620. end;
  621.  
  622. initialization
  623.   { checkVatPortType }
  624.   InvRegistry.RegisterInterface(TypeInfo(checkVatPortType), 'urn:ec.europa.eu:taxud:vies:services:checkVat', 'UTF-8');
  625.   InvRegistry.RegisterDefaultSOAPAction(TypeInfo(checkVatPortType), '');
  626.   InvRegistry.RegisterInvokeOptions(TypeInfo(checkVatPortType), ioDocument);
  627.   InvRegistry.RegisterInvokeOptions(TypeInfo(checkVatPortType), ioLiteral);
  628.   RemClassRegistry.RegisterXSClass(checkVatResponse, 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVatResponse');
  629.   RemClassRegistry.RegisterExternalPropName(TypeInfo(checkVatResponse), 'name_', '[ExtName="name"]');
  630.   RemClassRegistry.RegisterSerializeOptions(checkVatResponse, [xoLiteralParam]);
  631.   RemClassRegistry.RegisterXSInfo(TypeInfo(companyTypeCode), 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'companyTypeCode');
  632.   RemClassRegistry.RegisterXSClass(checkVatApprox, 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVatApprox');
  633.   RemClassRegistry.RegisterSerializeOptions(checkVatApprox, [xoLiteralParam]);
  634.   RemClassRegistry.RegisterXSClass(checkVat, 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVat');
  635.   RemClassRegistry.RegisterSerializeOptions(checkVat, [xoLiteralParam]);
  636.   RemClassRegistry.RegisterXSInfo(TypeInfo(matchCode), 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'matchCode');
  637.   RemClassRegistry.RegisterExternalPropName(TypeInfo(matchCode), '_1', '1');
  638.   RemClassRegistry.RegisterExternalPropName(TypeInfo(matchCode), '_2', '2');
  639.   RemClassRegistry.RegisterExternalPropName(TypeInfo(matchCode), '_3', '3');
  640.   RemClassRegistry.RegisterXSClass(checkVatApproxResponse, 'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVatApproxResponse');
  641.   RemClassRegistry.RegisterSerializeOptions(checkVatApproxResponse, [xoLiteralParam]);
  642.  
  643. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement