Jump to content

Stéphane Wierzbicki

Members
  • Content Count

    140
  • Joined

  • Last visited

Community Reputation

20 Excellent

About Stéphane Wierzbicki

  • Birthday July 20

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Stéphane Wierzbicki

    Need help adding namespaces to SOAP

    What disturbs me the most is the lack of available documentation and examples. I really don't know how to properly handle this... I've also tried to use Indy and send an pre-formatted XML file (thanks to SOAPUI) but it failed (504 Connection reset by peer). Maybe @Remy Lebeau can helps on this?
  2. Stéphane Wierzbicki

    Need help adding namespaces to SOAP

    Good morning, I have difficulties consuming a SOAP Web Service (obviously developed in C#). I managed to create the different Delphi classes via the WDSL import wizard. Unfortunately the request sent is not correctly formatted when generated by Delphi. I don't have any problems when I run my tests via SOAPUI. I have attached the two XML requests (the expected format generated by SOAPUI and the one generated by Delphi). I could see that the namespaces were not added to the different XML nodes/properties. Delphi generated SOAP Request <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <Invocar xmlns="http://www.smart-ix.com/SXAPI/"> <contexto> <CodNegocio>BUI</CodNegocio> <CodSistema>BUI</CodSistema> <Token/> <Usuario/> </contexto> <request> <Formulario> <VariableCircuitoConsultaInDTO> <Codigo>From</Codigo> <Valor>20190122</Valor> </VariableCircuitoConsultaInDTO> <VariableCircuitoConsultaInDTO> <Codigo>To</Codigo> <Valor>20190522</Valor> </VariableCircuitoConsultaInDTO> </Formulario> <Comando>Reporte_5</Comando> <Paginacion> <NroPagina>0</NroPagina> <RegistrosPorPagina>1</RegistrosPorPagina> <RetornaTotalRegistros>false</RetornaTotalRegistros> </Paginacion> <QuerySettings> <Paging> <PageNumber>1</PageNumber> <PageSize>1</PageSize> <TotalElements>1</TotalElements> <TotalPages>0</TotalPages> </Paging> </QuerySettings> <ReportCode>Reporte_5</ReportCode> </request> </Invocar> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAPUI SOAP Envelope (good) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sxap="http://www.blablabla.com/SXAPI/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:apis="http://schemas.datacontract.org/2004/07/APISX.Contracts.Query.Models"> <soapenv:Header/> <soapenv:Body> <sxap:Invocar> <!--Optional:--> <sxap:contexto> <sxap:CodNegocio>BUI</sxap:CodNegocio> <sxap:CodSistema>BUI</sxap:CodSistema> <sxap:CodProducto></sxap:CodProducto> <sxap:Usuario></sxap:Usuario> </sxap:contexto> <!--Optional:--> <sxap:request> <!--Optional:--> <sxap:Formulario> <VariableCircuitoConsultaInDTO> <Codigo>From</Codigo> <Valor>20190122</Valor> </VariableCircuitoConsultaInDTO> <VariableCircuitoConsultaInDTO> <Codigo>To</Codigo> <Valor>20190522</Valor> </VariableCircuitoConsultaInDTO> </sxap:Formulario> <!--Optional:--> <sxap:Aditional> </sxap:Aditional> <!--Optional:--> <sxap:Comando>Reporte_5</sxap:Comando> <!--Optional:--> <sxap:Paginacion> <sxap:NroPagina>0</sxap:NroPagina> <sxap:RegistrosPorPagina>20</sxap:RegistrosPorPagina> <sxap:RetornaTotalRegistros>false</sxap:RetornaTotalRegistros> </sxap:Paginacion> <sxap:QuerySettings> <apis:Filters> </apis:Filters> <apis:Paging> <apis:ContinuationToken></apis:ContinuationToken> <apis:PageNumber>1</apis:PageNumber> <apis:PageSize>20</apis:PageSize> <apis:TotalElements>20</apis:TotalElements> <apis:TotalPages>0</apis:TotalPages> </apis:Paging> <apis:Sorting> </apis:Sorting> </sxap:QuerySettings> <sxap:ReportCode>Reporte_5</sxap:ReportCode> </sxap:request> </sxap:Invocar> </soapenv:Body> </soapenv:Envelope> As you can see there are severals differencies. Envelop are not the same between Delphi and SOAPUI Namespace are missing in Delphi generated code. I tried to modify InvRegistry.RegisterMethodInfo(TypeInfo(ISrvConsultaCartera), 'Invocar', '','[ReturnName="InvocarResult"]', IS_OPTN or IS_NLBL); to InvRegistry.RegisterMethodInfo(TypeInfo(ISrvConsultaCartera), 'Invocar', 'sxap:Invocar',[ReturnName="InvocarResult"]', IS_OPTN or IS_NLBL); This worked but I have no clue on how to do this for other properties (paginacion, paging...) I search the internet but dod not found relevant info. Can someone help me on this ? Thank you Expected Soap Request.xml ISrvConsultaCartera1.pas Delphi Generated SOAP Request.xml
  3. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    It's not 😉, I know. I've implemented some checks before uploading data. I do have a mapping table used to control XLS file. XLS file is not uploaded if there is a change in the header (a column name changed for example). Problem is that I need to both update the mapping table and to create new fields in my database table. I wanted the later to be automatically handled by Tfdbatchmove component.
  4. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    Thanks Dmitry, do you have some advice on how to get this done in another way ?
  5. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    I forgot to tell you that I've already tried this. Removing from the the options set did not changed any thing.
  6. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    No, I'm sorry, I'm receiving those files every month and data needs to be appended into the same table.
  7. Stéphane Wierzbicki

    TFDBatchMoveSQLWriter and table structure updates

    Hello I transfer Excel data to an MS SQL database. To do this I use the TFDMemTable, TFDBatchMove and TFDBatchMoveSQLWriter components. The TFDMemTable field definitions are automatically created according to the Excel file (Excel columns and data type are used to create the field definitions). The name of the Excel file is used to fill in the Tablename property of the TFDBatchMoveSQLWriter component. When the TFDBatchMove is executed, the "TableName" table is created if it does not exist in the MS SQL database. If the table does exist, the data is inserted into it. This is perfect. I have a problem when the Excel file evolves and especially when a new column appears. TFDBatchMoveSQLWriter does not update the SQL table structure and the new field(s) are not created. Anyone have an idea to help me solve this problem? Maybe should I use another FireDac for this purpose? Here is my function function StoreDataset(aFDConnection: TFDConnection; aDataset: TDataSet; aTableName: string = ''; aOptions: TFDBatchMoveOptions = [poIdentityInsert, poCreateDest, poSkipUnmatchedDestFields, poUseTransactions]; aMode: TFDBatchMoveMode = dmAlwaysInsert): boolean; var FFDTable: TFDTable; FBatchmove: TFDBatchMove; FBatchmoveDatasetReader: TFDBatchMoveDataSetReader; FBAtchMoveSQLWriter: TFDBatchMoveSQLWriter; begin Result := False; if not assigned(aFDConnection) then raise Exception.Create('Please provide a Connection'); if not assigned(aDataset) then raise Exception.Create('Please provide a Dataset'); if aTableName = '' then aTableName := aDataset.Name; if aTableName = '' then raise Exception.Create('Please provide a table name'); FBatchmove := TFDBatchMove.Create(nil); FBatchmoveDatasetReader := TFDBatchMoveDataSetReader.Create(nil); FBAtchMoveSQLWriter := TFDBatchMoveSQLWriter.Create(nil); FFDTable := TFDTable.Create(nil); try FBatchmove.Reader := FBatchmoveDatasetReader; FBatchmove.Writer := FBAtchMoveSQLWriter; FBatchmove.Options := aOptions; FBatchmove.Mode := aMode; FBAtchMoveSQLWriter.Connection := aFDConnection; aFDConnection.Connected := True; FBatchmoveDatasetReader.Dataset := aDataset; FBAtchMoveSQLWriter.TableName := aTableName; try FBatchmove.Execute; Result := True; except on e: Exception do begin Result := False; TMSLogger.Exception(e.message); end; end; finally aFDConnection.Connected := False; FBatchmove.Free; FBatchmoveDatasetReader.Free; FBAtchMoveSQLWriter.Free; FFDTable.Free; end; end;
  8. Stéphane Wierzbicki

    Barcode reading on Honeywell and Zebra devices

    Thank you for sharing this!
  9. Stéphane Wierzbicki

    RAD Studio 10.3.3 now available

    Sorry for the confusion! I should have said that I don't understand why your fixes are not TOTALLY included in Delphi RIO! Anyways... I'm still thanking you for all your hard work.
  10. Stéphane Wierzbicki

    RAD Studio 10.3.3 now available

    Desperately waiting for IDE Fixpack... 😥
  11. Stéphane Wierzbicki

    SFTP client

    No criticism @Remy Lebeau but why SSH was never implemented into Indy?
  12. Stéphane Wierzbicki

    SFTP client

    Sorry for the confusion @Remy LebeauI need to connect to an SFTP server!
  13. Stéphane Wierzbicki

    Is it a bug? Using class helper into a package will "screwed" bpl output

    You are right.... It's my mind who was screwed.... Sorry but I found my mistake. I'm working with JVCL Plugin manager and I've created a bunch of plugins (packages). I forgot to update interfaces where I used the same GUID... Some of my packages where (badly) configure with GUI units (thus the output bpl size was bigger) Sorry for this bad topic !
  14. Hello, I spent hours on this.... to discover that my BPL are screwed as soon as I use a class helper in any pas file involved to build the package. Is this "normal"? When calling a class helper function my bpl output will be 250kb When removing the class heler my bpl output will be more than one 1.089kb Regards
  15. Stéphane Wierzbicki

    SFTP client

    I need a component or a library that allows me to connect to a sFTP server. I will check links you and @WillH posted.
×