soap icon indicating copy to clipboard operation
soap copied to clipboard

Issue parsing wsdl

Open chaz8080 opened this issue 6 years ago • 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: %{}
 }}

chaz8080 avatar Apr 16 '19 18:04 chaz8080

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}"

chaz8080 avatar Apr 17 '19 14:04 chaz8080