* * *

Author Topic: SOLVED - please help - need to consume WSDL, WST isn't importing it  (Read 1736 times)

Tomas Silva

  • New member
  • *
  • Posts: 24
Hello all,

This is my first post here.
I come from a Delphi background and recently started working with Lazarus.

I really need to get a SOAP web service client up an running. REST is not an option, as the WS is provided by my customer so I don't get a say on the matter.

I downloaded and installed Synapse and WST. Everything appears as it should. However, when I try to import the WSDL file from the customer, I get this:

Exception : Namespace not found : "http://schemas.xmlsoap.org/wsdl/soap/"

This happens both via ws_helper and via WSDL Importer.

I can access http://schemas.xmlsoap.org/wsdl/soap/ from my browser, so it's not a networking problem.

Can anyone please shine a light on this?

Thank you so much!
« Last Edit: January 15, 2018, 08:30:48 pm by Tomas Silva »

Phil

  • Hero Member
  • *****
  • Posts: 2731
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #1 on: January 14, 2018, 12:40:31 am »
Can anyone please shine a light on this?

Make sure you're using WST from SVN:

svn co https://svn.code.sf.net/p/lazarus-ccr/svn/wst/trunk .

I wouldn't use any earlier version.

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #2 on: January 14, 2018, 01:52:39 pm »
Hi Phil, thanks for the reply.

I am indeed using the WST from the SVN, in fact I just checked it out four days ago. That's the version where I'm having this issue.

Any further help?

Regards!

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #3 on: January 14, 2018, 02:02:08 pm »
Maybe some way to use a local copy of the namespace? I'm not sure if (and how) I could do this.

Or conversely - if the right way to do it would be ensuring the converter can read the namespace over the internet, how is it that one does that?

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #4 on: January 14, 2018, 02:16:16 pm »
In fact I tried making a local wsdl.xml from "http://schemas.xmlsoap.org/wsdl/soap/", replacing every occurrence of that address with a "file://" statement poiting to that file, and even replacing the namespace on the wsdl.xml with that same "file://".

Nothing seems to work. In fact, even after replacing every occurence of "http://schemas.xmlsoap.org/wsdl/soap/" that I could see, the same message still pops up:

Exception : Namespace not found : "http://schemas.xmlsoap.org/wsdl/soap/"

Phil

  • Hero Member
  • *****
  • Posts: 2731
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #5 on: January 14, 2018, 03:17:46 pm »
Exception : Namespace not found : "http://schemas.xmlsoap.org/wsdl/soap/"

If you're unable to post your customer's .wsdl file, maybe take a look at .wsdl files that CAN be parsed and see how your customer's file differs. For example, I've used this .wsdl for years and ws_helper parses it okay.

http://www.usgovxml.com/DataService.aspx?ds=NDFD

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #6 on: January 14, 2018, 03:26:42 pm »
Thanks, Phil! WST parsed that on my system as well. I'll get to studying and see what I find.

I'll report back here with the results, ok?

Regards!

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #7 on: January 15, 2018, 08:26:21 pm »
In the end I decided to go another way. After a few hours and with a little help from our friend SOAPUI, I managed to implement a fully functional web service client for all the services I needed, authentication and all, using Synapse's THTTPSend.

Works like a charm.

So the topic is not actually "solved", but I'm going to mark it so since no further help is required.

Anyway - thanks to Phil for taking the time to try and help me.  :)
« Last Edit: January 15, 2018, 08:27:56 pm by Tomas Silva »

Phil

  • Hero Member
  • *****
  • Posts: 2731
Re: please help - need to consume WSDL, WST isn't importing it
« Reply #8 on: January 15, 2018, 08:36:28 pm »
using Synapse's THTTPSend.

One disadvantage to that in my view is that your solution is now dependent on Synapse. An advantage to WST is that it's pluggable, meaning you can use Indy, Synapse, FPC's HTTP client, or even Apple's Foundation-based HTTP client on Mac and iOS.

This also illustrates why REST has displaced SOAP as quickly and as thoroughly as it has: REST is almost always easier to use than SOAP. Some useful discussion here:

http://spf13.com/post/soap-vs-rest/

I believe all of the services I use (over a dozen) now provide REST as an option (including NDFD above), so I've pretty much switched over completely from SOAP.

Tomas Silva

  • New member
  • *
  • Posts: 24
Re: SOLVED - please help - need to consume WSDL, WST isn't importing it
« Reply #9 on: January 15, 2018, 08:43:36 pm »
Quote
One disadvantage to that in my view is that your solution is now dependent on Synapse.
Sure, but the methodology I developed can easily be ported over to any other platform if needs be. That actually makes me more confident on the solution I arrived at.

Quote
This also illustrates why REST has displaced SOAP (...) all of the services I use (over a dozen) now provide REST as an option
Again, I agree. Though I find the structure of SOAP more appealing, the usability and platform independence of REST is way higher. If the web services in question were mine to develop, I would definitely give that a lot of thought - but, as I mentioned before, in this particular case I'm only consuming services provided by my customer, and I don't really have any say on the matter.

Thanks for all your input, you have added lots to my personal knowledge. Best regards to you!

Phil

  • Hero Member
  • *****
  • Posts: 2731
Re: SOLVED - please help - need to consume WSDL, WST isn't importing it
« Reply #10 on: January 15, 2018, 08:48:06 pm »
Thanks for all your input, you have added lots to my personal knowledge. Best regards to you!

And let's hope the service is using https.

With Windows and Synapse, Indy or FPC's HTTP client, that means including the appropriate 32-bit or 64-bit SSL libraries with your app. On Linux and Mac, these libraries are already installed (although their use is discouraged on Mac).


Tomas Silva

  • New member
  • *
  • Posts: 24
Re: SOLVED - please help - need to consume WSDL, WST isn't importing it
« Reply #11 on: January 15, 2018, 08:54:37 pm »
Hi Phil,

No SSL at present.


Tomas Silva

  • New member
  • *
  • Posts: 24
Re: SOLVED - please help - need to consume WSDL, WST isn't importing it
« Reply #13 on: January 15, 2018, 09:15:47 pm »
Thank you very much!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus