1

I have this service: https://mnavwcfservices.stcenergy.com/FlexProcurementService.svc?singleWsdl

I am trying to use this inside Delphi XE5

I have used the WSDL Importer

The generated file is here https://www.stcenergy-online.com/dev/service.txt

Although the top level classes have been generated correctly, the lists are using list of AnyType

How do I get the correct classes to be generated?

One example is ClipMonthSummaryLine - this is in the wsdl file but does not make it into the generated file by the WSDL importer which I think is why the ArrayOfType has come in

Paul
  • 2,773
  • 7
  • 41
  • 96
  • The link to `service.pas` is broken, but you should paste the source in the question not by an external link. – Sir Rufo Sep 20 '14 at 13:21
  • 1
    FYI The WSDL-Importer is not known as a well working instrument. You should better try [Web Service Toolkit](http://wiki.lazarus.freepascal.org/Web_Service_Toolkit) – Sir Rufo Sep 20 '14 at 13:22
  • Nearly the same question http://stackoverflow.com/questions/12245703/having-issue-with-delphi-wsdl-importer – Sir Rufo Sep 20 '14 at 13:25
  • sorry I have fixed the link, cant really paste pas file into the post as its huge! – Paul Sep 20 '14 at 17:15
  • I cant see how to integrate the web service toolkit into Delphi Xe5? – Paul Sep 20 '14 at 17:16
  • 1
    What makes you feel you have to integrate the toolkit to use it? Use the command line version – Sir Rufo Sep 21 '14 at 07:03
  • There is no executable command line tool that I can see – Paul Sep 21 '14 at 09:12
  • 1
    Look [here (wiki)](http://wiki.lazarus.freepascal.org/Web_Service_Toolkit#Import_by_ws_helper.) and [here (source)](http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/wst/) – Sir Rufo Sep 21 '14 at 10:00
  • I dont think this is an issue with the importer now - this is a problem with the WSDL file itself, it has dealt with Clip fine, but not with other classes like EnergyTransaction. Should I raise a new question? – Paul Sep 21 '14 at 11:16
  • Yes, but remember to add the common `delphi` tag and there is no need to add your name at the end of the question. We already can see your name right hand below the question. – Sir Rufo Sep 21 '14 at 12:26
  • Have you checked the service with some other tools (fi http://wsdlbrowser.com ) – Sir Rufo Sep 21 '14 at 12:30
  • The WSDL looks fine to me. You should try SoapUI (imho an absolutely indispensible tool) to check that the service and the WSDL are ok. – mjn Sep 21 '14 at 14:10
  • I have found the problem its that my classes are using lists of interfaces. Even though I use KnownType this seems to be what is causing the issue any ideas how to get round this? This is probably the best thing for a new question actually – Paul Sep 21 '14 at 14:42
  • Hi Paul, since your problem has been solved by using [concrete classes](http://stackoverflow.com/questions/25961758/list-not-loaded-correctly-from-soap-message-wcf) in your service could add an answer here? – bummi Sep 21 '14 at 17:20

1 Answers1

0

This appears to have been caused by the use of interfaces in the C# classes

This is an absolute nightmare for me now as I never have lists of concrete classes but I think I can get round this by creating new classes that use concrete lists and mapping the data

Sir Rufo's response suggested using the Web Services Toolkit as opposed to the default WDSL importer that comes with Delphi. Although this looks very good it has proved to be a total nightmare to use to the point I may have to raise a new question about it. My new problem https://stackoverflow.com/questions/25961758/list-not-loaded-correctly-from-soap-message-wcf may have been caused by the default importer as well, but getting the files generated by the toolkit to work in Delphi is a nightmare and the documentation is not as good as it first appears.

Community
  • 1
  • 1
Paul
  • 2,773
  • 7
  • 41
  • 96