Recent

Author Topic: SOAP code generator from a wsdl file  (Read 854 times)

Bogen85

  • Hero Member
  • *****
  • Posts: 695
SOAP code generator from a wsdl file
« on: September 24, 2024, 03:19:03 am »
Is there any tool for free pascal to generate a unit (or units?) for communicating with a SOAP API server given the .wsdl file from that server?

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: SOAP code generator from a wsdl file
« Reply #1 on: September 24, 2024, 06:59:14 am »
Best regards / Pozdrawiam
paweld

Bogen85

  • Hero Member
  • *****
  • Posts: 695
Re: SOAP code generator from a wsdl file
« Reply #2 on: September 24, 2024, 09:59:33 am »
Web Service Toolkit: https://wiki.lazarus.freepascal.org/Web_Service_Toolkit

Thanks. This is not in the current sources for Lazarus (been renamed? removed?). Have not tracked it down yet.

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: SOAP code generator from a wsdl file
« Reply #3 on: September 24, 2024, 10:08:48 am »
You can find it in Online Package Manager under the name WST.
Or download from: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/wst/ (svn) or https://gitea.brudnopis.ovh/paweld/lazarus-ccr/src/branch/master/wst (git)
« Last Edit: September 24, 2024, 10:11:35 am by paweld »
Best regards / Pozdrawiam
paweld

korba812

  • Sr. Member
  • ****
  • Posts: 442
Re: SOAP code generator from a wsdl file
« Reply #4 on: September 24, 2024, 10:11:50 am »
WST sources can be found in Lazarus-CCR repository:
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/wst/

Bogen85

  • Hero Member
  • *****
  • Posts: 695
Re: SOAP code generator from a wsdl file
« Reply #5 on: September 24, 2024, 10:54:22 am »
Thank you.

ws_helper is GPL. That is fine. However, is the generated code able to be used in non GPL software?


Bogen85

  • Hero Member
  • *****
  • Posts: 695
Re: SOAP code generator from a wsdl file
« Reply #6 on: September 24, 2024, 11:08:36 am »
Alright, that was simple enough

Code: Bash  [Select][+][-]
  1. git clone https://gitea.brudnopis.ovh/paweld/lazarus-ccr.git
  2. cd lazarus-ccr/wst/trunk/ws_helper
  3. lazbuild ws_helper.lpi
  4. ./ws_helper
  5.  

Code: Text  [Select][+][-]
  1. ws_helper, Web Service Toolkit 0.7 Copyright (c) 2006-2017 by Inoussa OUEDRAOGO
  2. ws_helper [-uMODE] [-gOPTION] [-cOPTION] [-p] [-b] [-i] [-w] [-x] [-y] [-d] [-j] -[fSPECIFACTIONS] [-oPATH] [-aPATH] inputFilename
  3.   -u MODE Generate the pascal translation of the WSDL input file
  4.         MODE value may be U for used types or A for all types
  5.   -g  Code generation option, with the following options :
  6.         A  : object arrays are generated as "array" derived from TBaseObjectArrayRemotable
  7.         C  : object arrays are generated as "collection" derived from TObjectCollectionRemotable
  8.         EP : enum type's items are prefixed with the enum name
  9.         EN : enum type's items are not prefixed with the enum name, the default
  10.         FN : do not create fields for "choice"'s items in constructor
  11.         FO : create fields for "choice"'s items in constructor, the default
  12.         SS : XSD'string type is mapped to Object Pascal' String
  13.         SU : XSD'string type is mapped to Object Pascal' UnicodeString
  14.   -p  Generate service proxy
  15.   -b  Generate service binder
  16.   -i  Generate service minimal implementation. This will erase any existing implementation file!
  17.   -o  PATH  Relative output directory
  18.   -a  PATH  Absolute output directory
  19.   -w  Generate WSDL file; Can be used to get wsdl from pascal
  20.   -x  Generate XSD file; Can be used to get xsd from pascal
  21.   -y  Generate easy access interface for wrapped parameters
  22.   -d  Generate documentation as comment in the interface file
  23.   -c  Indicate the parser's case sensitivity :
  24.         S  : the paser is case sensitive
  25.         I  : the paser is not case sensitive
  26.   -j  Generate Java Language interface files for
  27.   -f  Specify unit(s) renaming option : oldName= NewName(;oldName= NewName)*
  28.  

Now just need to know what license (if any) the generated code would be bound by.

Bogen85

  • Hero Member
  • *****
  • Posts: 695
Re: SOAP code generator from a wsdl file
« Reply #7 on: September 24, 2024, 11:10:18 am »
There is this: https://wiki.lazarus.freepascal.org/Web_Service_Toolkit#License

But not sure if that what the generated call falls under.

Bogen85

  • Hero Member
  • *****
  • Posts: 695
Re: SOAP code generator from a wsdl file
« Reply #8 on: September 24, 2024, 11:20:09 am »
Code: Bash  [Select][+][-]
  1. $ ws_helper -o out -p -b -c I ./server.wsdl
  2. ws_helper, Web Service Toolkit 0.7 Copyright (c) 2006-2017 by Inoussa OUEDRAOGO
  3. Parsing the file : ./server.wsdl
  4. Information : Parsing the port type "VoIPms"
  5. Information : Parsing operation "addCharge"
  6. Information : Parsing "xsd1:addChargeInput" ...
  7. Error : Unable to find the parser, namespace : "http://schemas.xmlsoap.org/soap/encoding/". soapenc:Array type
  8. Exception : Unable to find the parser, namespace : "http://schemas.xmlsoap.org/soap/encoding/".
  9.  

Thaddy

  • Hero Member
  • *****
  • Posts: 16193
  • Censorship about opinions does not belong here.
Re: SOAP code generator from a wsdl file
« Reply #9 on: September 24, 2024, 11:29:48 am »
There is this: https://wiki.lazarus.freepascal.org/Web_Service_Toolkit#License

But not sure if that what the generated call falls under.
In this case the generated calls fall under your own license. Changes to the generator itself are lgpl with linker exception. That is not always the case, e.g. a generator may have inadvertently generated copyrighted code or even patented code, so you need to be careful. (OpenAI bitten me in some cases.)
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018