Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map into Map as params? #82

Open
HaNdlezz opened this issue Feb 14, 2020 · 3 comments
Open

Map into Map as params? #82

HaNdlezz opened this issue Feb 14, 2020 · 3 comments

Comments

@HaNdlezz
Copy link

HaNdlezz commented Feb 14, 2020

Hi,
the params in the call, are defined in the documentation as: %{key: value},
if i need define map into map,is accepted as valid params?
i try, but i get a error

example:%{key: value, key2: %{key3: value}}

@Nitrino
Copy link
Member

Nitrino commented Feb 14, 2020

@HaNdlezz Hi. Nested maps should work. what error do you get?

I checked with a test WSDL file:

params = params = %{example: %{key: "key_data", key2: %{key3: "key3_data"}}}
Soap.call(wsdl, "getRates", params)

result:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<env:Envelope xmlns:=\"http://schemas.xmlsoap.org/wsdl/\" 
    xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" 
    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
    <env:Header/>
    <env:Body>
        <getRates xmlns=\"http://fedex.com/ws/rate/v26\">
            <example>
                <key>key_data</key>
                <key2>
                    <key3>key3_data</key3>
                </key2>
            </example>
        </getRates>
    </env:Body>
</env:Envelope>

@HaNdlezz
Copy link
Author

Hi, thanks for you answer.

I have this file: http://serviciosdls.starken.cl/TrackingCarga/TrackingCargaServiceWS?WSDL,
when i run Soap.init_model(file_path, :file), y get a response without operations (operations: [ ]),
in this case, i modified the file, in specific:
before:
image

after:
image

Whit this modification in the file, Soap.init_model(file_path, :file), recognize the operation "detalleTrackingCarga", so, i run:
Soap.call(wsld, "detalleTrackingCarga", params)..
and i get:
image

Here the operations availables:
image

Here, the full process:
image

Ty for your answers my friend,
cheers

@Liferenko
Copy link

Liferenko commented Feb 24, 2021

I've got the same issue. Looks like it tries to Enum.find(fn x -> x[:name] == operation end) in our WSDL file, but there is an empty wsdl[:complex_types] list.

It crashes on /deps/soap/lib/soap/request/params.ex:220

UPD:
I was outstep that issue (and finally got a SoapFault) when I changed mix.exs in line [{:soap, git: "https://github.com/elixir-soap/soap"}], after it mix deps.unlock soap && mix deps.get.
It is not a solution, but it's one step closer to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants