elixir-soap / soap

SOAP client for Elixir programming language
MIT License
135 stars 75 forks source link

WSDL parse crashes #51

Closed beno closed 5 years ago

beno commented 5 years ago

I have a WSDL of a SOAP service I need to talk to, but when trying to build a client with it it crashes. The stack trace is so deep I really can't figure out what is going on (maybe this is a SweetXML bug?), but maybe you can take a look? This is Elixir 1.7.3.

WSDL

http://vinsearch.eurotaxglass.com/vin-intl/?wsdl

Error:

test/inventory/autovista_test.exs:14
** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Postgrex.Stream, Range, Stream
code: Autovista.vin_check("WVWZZZ3CZCE116344")
stacktrace:
  (elixir) /Users/michel/.kiex/builds/elixir-git/lib/elixir/lib/enum.ex:1: Enumerable.impl_for!/1
  (elixir) /Users/michel/.kiex/builds/elixir-git/lib/elixir/lib/enum.ex:141: Enumerable.reduce/3
  (elixir) lib/stream.ex:933: Stream.do_enum_transform/7
  (elixir) lib/stream.ex:857: Stream.do_transform/5
  (sweet_xml) lib/sweet_xml.ex:582: anonymous fn/4 in SweetXml.continuation_opts/2
  (xmerl) xmerl_scan.erl:568: :xmerl_scan.scan_document/2
  (xmerl) xmerl_scan.erl:291: :xmerl_scan.string/2
  (sweet_xml) lib/sweet_xml.ex:237: SweetXml.parse/2
  (sweet_xml) lib/sweet_xml.ex:421: SweetXml.xpath/2
  (sweet_xml) lib/sweet_xml.ex:531: anonymous fn/3 in SweetXml.xmap/3
  (elixir) lib/map.ex:791: Map.get_and_update/3
  (sweet_xml) lib/sweet_xml.ex:531: SweetXml.xmap/3
  (sweet_xml) lib/sweet_xml.ex:530: SweetXml.xmap/3
  (soap) lib/soap/wsdl.ex:32: Soap.Wsdl.parse/2
sigmen commented 5 years ago

Fixed in #56