Anyone ever had to consume WSDLs from Elixir?

We are currently using PHP when we have to integrate with all the “wonderful” Ad related WSDLs (AdWords etc. ) but going forward would be nice to have an option to use Elixir. Any of you guys have any experiences/advice to share on integrating/using WSDLs with Elixir?

1 Like

I haven’t dealt with WSDL in a long time but I oddly kind’ve miss it. It was really nice being able to do client side call validation for all of my API calls as the standard…but the SOAP and XML…ugh.

IMO if somebody were to develop a WSDL library for Elixir today it would be nice to setup a Postgresql XML column for WSDL caching as part of it. Outside of that I’d assume you’d want to see a mix generator of some sort.

3 Likes

I would do some proxy:
erlang/elixr < —> java microservice <—WSDL—> Google Adword WSLD

If you don’t like java there also other languages:
https://developers.google.com/adwords/api/docs/clientlibraries

That’s pretty much what we are planing to do -Java + PHP, but was wondering if anyone tried anything directly with Elixir

Remember - there is always the Erlang escape hatch.

github.com/bet365/soap (Erlang)
github.com/devinus/detergent (Erlang)
github.com/r-icarus/detergentex (Elixir)

SOAP in Elixir with soap

That being said I’d cross my fingers anytime you consume a code-first WSDL[1].

[1] A contract-first WSDL is designed in “XML-space”, i.e. all the documents that are part of the client-server conversation are designed independently of the server implementation details. Code-first (contract-last) WSDL is generated from the server code - typically dumping an object-model into any number of XML-documents; this transformation has the tendency to leak details of the server’s implementation (language) into the contract that can make some clients choke (Contract-to-Implementation, Contract-To-Logic coupling).

10 Likes

Thank you very usefull links

I have developed a microservice to consume a web service over soap. I tried with detergentex first, but something didn’t work. After an half day of failed attempts I gave up and implemented the whole thing by hand by forging requests, and parsing response with xmerl. I’m not saying it’s the way to go…but for us wsdl and php was a no-go. We were in fact escaping by that, the SoapClient class has many many problems with socket, external connections that drop and the like.

This is my experience. I hope to never have to do it again… :smile:

4 Likes

Same experience as matteosister. I needed to access a Web Service to use the OnVIF interfaces in cameras and I ended up using HTTPotion and xmerl. Code is not pretty but does the job. I want to take a look at bet365/soap. Maybe, (just maybe) is the right tool for this kind of problems.
You can find my code in https://github.com/evercam/evercam-media/tree/master/lib/evercam_media/onvif. Feel free to contribute, comment, etc.

4 Likes