Coder Social home page Coder Social logo

detergentex's People

Contributors

jonhkr avatar r-icarus avatar shymega avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

detergentex's Issues

Pass an empty parameter

How to pass an empty parameter. For example, I have method with 5 parameters and first parameter must be empty. I try pass nil, empty string("", " "), but without success, throw {:error, 'nil value provided for non-nillable element}
Although the first parameter of method is <nillable="true"/>

Problem with erlsom parsing

I get the following error:

iex(1)> Detergentex.call("http://webapi.allegro.pl/service.php?wsdl", "doQuerySysStatus", [])
** (throw) {:error, 'Struct doesn\'t match model: recordtype not expected: p:doQuerySysStatus'}
    (erlsom) src/erlsom_write.erl:357: :erlsom_write.findAlternative/4
    (erlsom) src/erlsom_write.erl:258: :erlsom_write.processSubType/5
    (erlsom) src/erlsom_write.erl:241: :erlsom_write.processElementValues/7
    (erlsom) src/erlsom_write.erl:132: :erlsom_write.struct2xml/6
    (erlsom) src/erlsom_write.erl:323: :erlsom_write.processAlternativeValue/8
    (erlsom) src/erlsom_write.erl:241: :erlsom_write.processElementValues/7
    (erlsom) src/erlsom_write.erl:116: :erlsom_write.struct2xml/6
    (erlsom) src/erlsom_write.erl:323: :erlsom_write.processAlternativeValue/8

even if I have this operation listed:

iex(2)> Detergentex.init_model("http://webapi.allegro.pl/service.php?wsdl")
{:wsdl,
 [
  {:operation, 'serviceService', 'servicePort', 'doQuerySysStatus',
   'serviceBinding', 'https://webapi.allegro.pl/service.php',
   '#doQuerySysStatus'},
  ...
 {:model,
  [{:type, :_document, :sequence,
    [{:el,
      [
       {:alt, :"p:doQuerySysStatusResponse", :"p:doQuerySysStatusResponse", [],
        1, 1, true, :undefined},
        ...
      ]
  }]}]}
 ]
 ...
}

What may be the reason?

Add header to SOAP Request

Does anyone have an example about how to add header to request? I'm searching and trying for whole night without any positive result.

Thank you so much

https support

SOAP requests to https urls fails with {:error, :enoent}

I traced it back to src/detergent.erl in deps, which doesn't have pattern matching for URLs starting with https. It falls back to reading from a local file with the name of the URL, which doesn't exist. The code I'm seeing is

get_url_file("http://"++_ = URL) ->
    case httpc:request(URL) of
    {ok,{{_HTTP,200,_OK}, _Headers, Body}} ->
        {ok, Body};
    {ok,{{_HTTP,RC,Emsg}, _Headers, _Body}} ->
        error_logger:error_msg("~p: http-request got: ~p~n", [?MODULE, {RC, Emsg}]),
        {error, "failed to retrieve: "++URL};
    {error, Reason} ->
        error_logger:error_msg("~p: http-request failed: ~p~n", [?MODULE, Reason]),
        {error, "failed to retrieve: "++URL}
    end;
get_url_file("file://"++Fname) ->
    {ok, Bin} = file:read_file(Fname),
    {ok, binary_to_list(Bin)};
%% added this, since this is what is used in many WSDLs (i.e.: just a filename).
get_url_file(Fname) ->
    {ok, Bin} = file:read_file(Fname),
    {ok, binary_to_list(Bin)}.

However detergent at https://github.com/devinus/detergent/blob/master/src/detergent.erl has the same version of the dependency in detergentex (0.3.0) and does support https (https://github.com/devinus/detergent/blob/master/src/detergent.erl#L395).

get_url_file(URL) ->
    case xmerl_uri:parse(URL) of
        {http, _, _, _, _} -> get_remote_file(URL);
        {https, _, _, _, _} -> get_remote_file(URL);
        _Other -> get_local_file(URL)
end.

That was added in 2013 with devinus/detergent@5354f1c#diff-c46a9580e05c152c0b037750f88eb760

It happens that detergentex is downloading an older detergent or some different fork. However https://hex.pm/packages/detergent links to https://github.com/devinus/detergent

I wonder if there is some dependency mismatch and if mix.exs could be updated to depend from the version at https://github.com/devinus/detergent

Thanks

Access to authenticated web services.

Hi Ricardo,
Does detergentex support authenticated services? I need to contact a service using elixir that requires username/password.
Thank you.

erlsom ArgumentError

iex(29)> wsdl_url
"http://www1.carwebuk.com/CarweBVrrB2Bproxy/carwebVrrWebService.asmx?wsdl"
iex(30)> action
"strB2BGetVehicleByVRM"
iex(31)> params
["strClientDescription", 'test']
iex(32)> Detergentex.call(wsdl_url, action, params)
** (ArgumentError) argument error
    src/erlsom_write.erl:64: :erlsom_write.struct2xml/6
    src/erlsom_write.erl:326: :erlsom_write.processAlternativeValue/8
    src/erlsom_write.erl:239: :erlsom_write.processElementValues/7
    src/erlsom_write.erl:130: :erlsom_write.struct2xml/6
    src/erlsom_write.erl:326: :erlsom_write.processAlternativeValue/8
    src/erlsom_write.erl:239: :erlsom_write.processElementValues/7
    src/erlsom_write.erl:114: :erlsom_write.struct2xml/6
    src/erlsom_write.erl:326: :erlsom_write.processAlternativeValue/8
    src/erlsom_write.erl:239: :erlsom_write.processElementValues/7
    src/erlsom_write.erl:45: :erlsom_write.write/2
    src/detergent.erl:211: :detergent.call_attach/8

No idea why this happens :/

Any info on what i can do to get closer is also welcome, but my erlang is very limited

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.