elixir-soap/soap

Issue parsing wsdl

chaz8080 opened this issue · 1 comments

I have a wsdl url that seems to be leaving several fields empty when calling init_model: http://services.chromedata.com:80/Description/7a?WSDL

Steps to replicate:

iex> wsdl_path = "http://services.chromedata.com:80/Description/7a?WSDL"
iex> {:ok, wsdl} = Soap.init_model(wsdl_path, :url)
{:ok,
 %{
   complex_types: [],
   endpoint: "",
   messages: [],
   namespaces: %{},
   operations: [],
   schema_attributes: %{
     element_form_default: "qualified",
     target_namespace: "urn:description7a.services.chrome.com"
   },
   soap_version: "1.1",
   validation_types: %{}
 }}

The issue seems to be that this particular wsdl has valid namespaces, but none of the prefixes are present. Line 221 of wsdl.ex prepends the prefixes with the namespaces, and since they aren't there in the wsdl, most of the xpath queries return nothing:

defp ns(name, namespace), do: "#{namespace}:#{name}"