rameshsharma
How to create a soap service in elixir and phoenix. I went through some of the links but nowhere I could get complete guidance on development of a soap service in elixir and phoenix. I have a wsdl url and a request xml. On hitting the wsdl url with the request xml in soap ui, I am getting a proper response. I want to develop this calling of the wsdl and getting a response in elixir and phoenix. What should I refer to. Could not find very useful reference till now. Can someone please guide me.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
halostatue
If you can, build a REST-to-SOAP service in a language that has good SOAP support. I have tried all of the various SOAP libraries in Erlang and Elixir and have yet to find one that can properly parse the WSDLs that I had to deal with (they all failed at some point or another)
I ended up using Ruby with
soap4r(well,soap4r-ng), because neithersavonnorlolsoapcould handle the complexity of the SOAP service I used.SOAP is a nasty piece of work because it’s fully object oriented and if your service was built system-first, rather than WSDL-first, you will have heavy object orientation and polymorphism to deal with and pretty much all of the Erlang/Elixir SOAP services that I played with failed.
If I have to deal with another SOAP service (I’m usually doing enterprise integrations, so it’s not unlikely), I will either do the same thing or build my own WSDL/WSSE/SOAP layer with the goal of open sourcing it, but that’s probably a year in the future at least. It’s a hard thing, because once we got started with the
soap4rapproach, we had our gateway and Elixir code implemented in about two weeks. It would have taken two weeks just to get a working WSDL parser for Elixir to handle the multiple WSDLs I had to deal with.I love Elixir, but there’s no good answer to doing SOAP in Elixir at this point.
rameshsharma
Thanks Austin for sharing your experience. My requirement is SOAP service only in Elixir. I have only 1 WSDL which I have to work on.
I referrred to the below link for implementation but the tutorial is not so good:-
https://github.com/elixir-soap/soap
halostatue
I understand. You might have success with one of the various projects I list below, but it entirely depends on whether the WSDL represents something that was written and the service code was written from it…or whether the WSDL is something generated from the service code. The former presents interfaces that conform to spec far more frequently and simply. The latter will do things that are possible in the spec, but don’t happen in WSDL-first services, which means that most WSDL parsers handle them poorly.
Here are all the toolkits I’ve tried before basically punting:
Of these, bet365/soap is the most mature but hasn’t been maintained in years; polyfox/castile is promising but hasn’t been maintained in a long time; zdeneksejcek/soapex is really interesting but incomplete. None of them worked with any one of the four WSDLs I had to work with.
If yours is a simple enough service, you’d probably be better off building EEx templates for sending the requests and XML parsers for receiving the requests and calling the services with an HTTP client (most SOAP is over HTTPS, after all).
If it’s not a simple service…all I can say is good luck doing it in Elixir. SOAP is a technology that only works really well if you have relatively large engineering teams building the code tooling around the excessively complicated standards. The absolute best platforms/languages to develop SOAP services and clients are Java and C#—because the SOAP standards were mostly written by people who work at Oracle (and Sun before that), IBM, SAP, and Microsoft.
The truth is, I don’t want to write a SOAP client in Elixir—because I don’t want to use SOAP if I can avoid it, and that disdain also means that I’m not likely to maintain it (even the Ruby toolkit that I ended up using,
soap4r-ng, hasn’t been maintained in a few years, but it’s a lot more mature than anything in Elixir/Erlang that does SOAP).dimitarvp
Good summary. I’d question OP’s requirement to create SOAP service (of all things!) but they might be stuck with a strong-headed customer.
@rameshsharma Are there not other options? What are you trying to achieve exactly?
rameshsharma
Thanks Austin for the detailed summary.
I have a wsdl url mentioned below. I have to develop a soap service to hit the wsdl using a request xml and get a response. Based on the below url can you suggest me the best approach of work.
https://sandbox.ws-idu.tracesmart.co.uk/v5.6/?wsdl
Is there any reference link of the above point mentioned by you:
‘‘If yours is a simple enough service, you’d probably be better off building EEx templates for sending the requests and XML parsers for receiving the requests and calling the services with an HTTP client (most SOAP is over HTTPS, after all).’’
halostatue
This is based on a quick reading of the WSDL, but I think that it’s simple enough (it isn’t using any polymorphism that I can see, except in arrays) that it should work with pretty much any of the existing toolkits. It is not simple enough that you could reliably make EEx templates without a lot of example payloads.
The EEx template approach is just one where you get a full-change payload and then use EEx template logic, looping, and substitution to build an appropriate XML file for a payload.
rameshsharma
Thanks Austin. So I think then I can go for elixir-soap/soap.
I am completely new to SOAP service in Elixir. The documentation below does not clearly state how to send request xml to hit the wsdl and get the response back.
https://github.com/elixir-soap/soap
Is there any reference anywhere?
rameshsharma
On hitting the below command in interactive shell, I am getting the below output.
iex:4> {:ok, wsdl} = Soap.init_model(“https://sandbox.ws-idu.tracesmart.co.uk/v5.6/?wsdl”, :url)
{:ok,
%{
complex_types: ,
endpoint: “”,
messages: ,
namespaces: %{},
operations: ,
schema_attributes: %{element_form_default: “”, target_namespace: “urn:idu”},
soap_version: “1.1”,
validation_types: %{}
}}
Not sure why complex_types, operations are all showing .
OvermindDL1
Don’t neglect erlang libraries for soap handling as well. Soap was more of a big thing back in erlang’s creation days.
But for note, soap is just (mostly) xml in various defined ways, it’s not hard to do it manually with no libraries at all.
rameshsharma
Thanks, by erlang library you mean to refer to bet365/soap ??